java - HttpPost - type of http request method -


hi :) got simple problem, annoying. i'm trying send http post request using httppost class

this part of method returns inputstream:

           httpclient httpclient = new defaulthttpclient();         httppost httppost = new httppost(url+path);          arraylist<namevaluepair> paramslist = new arraylist<namevaluepair>();         paramslist.add(new basicnamevaluepair("key1", value1));         paramslist.add(new basicnamevaluepair("key2", value2));         paramslist.add(new basicnamevaluepair("key3", value3));          httppost.setentity(new urlencodedformentity(paramslist));          httpresponse httpresponse = httpclient.execute(httppost);         httpentity httpentity = httpresponse.getentity();         inputstream = httpentity.getcontent();         return is; 

but problem on server, because server "thinks" im sending request instead of post. question is: mistake? im using similar part of code in other application , works fine.

cheers. :)

please try

httppost.setentity(new urlencodedformentity(paramslist, http.utf_8)); 

instead of

httppost.setentity(new urlencodedformentity(paramslist)); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -