I am trying to send JSON object from android app to my servlet using HttpPost.
But while retrieving this JSON object at server side I am getting null.
Below is code snippet-
In android app-
HttpClient client = new DefaultHttpClient();
>
> HttpPost request = new HttpPost(hostNameCollection);
>
> StringEntity se = new StringEntity(jsonObj.toString());
>
> request.setHeader("Accept", "application/json");
> request.setHeader("Content-type", "application/json");
>
>
> request.setEntity(se);
> HttpResponse response = client.execute(request);
>
>
In java servlet(under post method)-
req.getParameterMap();
I have also try to send post parameter using NameValuePair but it could
also not solve the problem.
Please suggest what should I do to get rid of this.
Thanks in advance. :)
--
--
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
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.