pawan nimje wrote:
> I want to send a post request. This is what i have done-
>
> HttpClient client = new DefaultHttpClient();
> HttpPost httpost = new HttpPost(POST_URL);
> StringEntity se = new StringEntity(j.toString());
> httpost.setEntity(se);
> httpost.setHeader("Accept", "application/json");
> httpost.setHeader("Content-type", "application/json");
> ResponseHandler<?> responseHandler = new BasicResponseHandler();
> Object response = client.execute(httpost, responseHandler);
>
> But along with the post request i want to set multiple form parameters
> of the POST_URL using post request.
> How do I do that?
You're not using form parameters, so you cannot have multiple form
parameters, AFAIK.
Here is an example using a POST with form parameters:
http://svn.apache.org/repos/asf/httpcomponents/httpclient/branches/4.0.x/httpclient/src/examples/org/apache/http/examples/client/ClientFormLogin.java
(or http://bit.ly/9kx3hA if that URL is too long)
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
Android Training...At Your Office: http://commonsware.com/training
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en