Android POST JSON OBJECT - How to set $_POST Index
<p>i have a JSONObject which i want to POST to a server. </p>

<p>Here is the Code:</p>

<pre><code>JSONObject obj = new JSONObject();
for(int k = 0; k&lt;len;k++){
    obj.put("nachrichten_ids", params[k]);
}
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("xxxxx");
HttpEntity entity;
StringEntity s = new StringEntity(obj.toString());
s.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
entity = s;
httpPost.setEntity(entity);
HttpResponse response;
response = httpClient.execute(httpPost);
</code></pre>

<p>By doing Log.i("TEST",obj) i get the JSON object:</p>

<p><strong>{"nachrichten_ids":"[2144,2138]"}</strong></p>

<p>That data is send to the server. But i cant access it:
<strong>There is no $_POST index.</strong>  (PHP)</p>

<p>How to set a index, so that i can access the json object, <strong>like $_POST['nachrichten_ids']</strong>.
I had to work with that data then e.g with php json_decode()</p>

<p>Any idea ?</p>

<p>Thanks</p>
