title: How send json in php with HttpURLConnection to read like 'php://input'?
body: <p>I try to read data from json send by HttpURLConnection. </p>
  
  <p>Activity.</p>
  
  <pre><code> Gson gson = new GsonBuilder().create();
   String json = gson.toJson(cDati);
  
   if(FunzioniSalvataggio.getInstance(mContext).saveDataToSend(json,"InizioServizio_")) 
     new FunzioniInvio().execute(json); 
  </code></pre>
  
  <p>AsyncTask.</p>
  
  <pre><code> URL paginaURL = new URL("http:***");
  
   HttpURLConnection client = (HttpURLConnection) paginaURL.openConnection();
   client.setChunkedStreamingMode(0);
   client.setDoOutput(true);
   client.setDoInput(true);
   client.setRequestProperty("X-Requested-With", "XMLHttpRequest");
   client.setRequestProperty("Content-Type", "application/json");
   client.setRequestMethod("POST");
  
   client.connect();
  
   OutputStreamWriter wr = new OutputStreamWriter(client.getOutputStream());
   wr.write(json);
   wr.flush();
  
   InputStream risposta = new BufferedInputStream(client.getInputStream());
   dati = mostroDati(risposta);
  </code></pre>
  
  <p>PHP.</p>
  
  <pre><code>$postdata = file_get_contents("php://input");  
  $json = json_decode($postdata, true);
  </code></pre>
  
  <p>But when PHP page try to read it with "php://input", it not found data. How do it?</p>