Need to post JSONObject to PHP server through parameter
<p>From past couple of hour I was trying to send JSONObject to a PHP server. I need to send this object through a parameter.</p>

<p>Some what like this:</p>

<pre><code>message={"name":"Firstname","email":"test@test.com"}
</code></pre>

<p>here message is my parameter name.</p>

<p>Yes I am using HttpClient for posting my request.   As I have mentioned that I need to send a post request to the server attaching a JSONObject to a parameter, I am using the following methods:</p>

<p>Supose my exact URL is like <a href="http://www.example.com/" rel="nofollow">http://www.example.com/</a> then I need to append deviceID, date and message type with the URl so as to make it look like <a href="http://www.example.com/deviceID/date/140" rel="nofollow">http://www.example.com/deviceID/date/140</a> then to this URL I need to send a post request which is a JSONObject attaching it to a parameter named message.</p>

<p>For this I am doing:</p>

<pre><code>String url = "http ://www.example.com/deviceID/date/140";
JSONObject j = new JSONObject();
j.put("name", "Firstname");
j.put("email", "test@test.com");

HttpClient httpclient = new DefaultHttpClient();
HttpPost request = new HttpPost(url);
BasicHttpParams params = new BasicHttpParams();
params.setParameter("message",j.toString());
request.setParams(params);
HttpResponse response = httpclient.execute(request);
</code></pre>

<p>If I pass this way, the server returns a JSONObject error message saying <code>"error":"name not found"</code> -- what am I doing wrong?</p>
