Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to send a post, but the server check if the post have accepting for session,
what is the code who i need to attach?

It's part of my post code:
Java
StringEntity entity = new StringEntity(xmlSend, "UTF-8");
DefaultHttpClient httpClient = new DefaultHttpClient();

HttpPost post = new HttpPost(watchUrl);
post.addHeader(" * ", " * ");
post.setEntity(entity);

HttpResponse response = httpClient.execute(post);

if(response != null) {
    InputStream inputstream = response.getEntity().getContent();
    String xmlGet = StmToStr(inputstream);          
}

Thanks for helpers...
Posted
v3

1 solution

You have to send the cookie as a part of request. This might help you.

http://hc.apache.org/httpcomponents-client-4.3.x/primer.html
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900