title: How to send post parameter which can be read by php
body: <p>I have some connection to url:</p>
  
  <pre><code>HttpURLConnection connection = (HttpURLConnection) url.openConnection();
  </code></pre>
  
  <p>How I can send post parameter to this url that php function: <a href="http://www.php.net/manual/en/reserved.variables.request.php" rel="nofollow noreferrer">http://www.php.net/manual/en/reserved.variables.request.php</a> can read it ? I try to according this question: <a href="https://stackoverflow.com/questions/4205980/java-sending-http-parameters-via-post-method-easily">Java - sending HTTP parameters via POST method easily</a> but with no success. It just display empty array</p>
  
  <p>php code:</p>
  
  <pre><code>print_r($_REQUEST,1)
  </code></pre>
  
  <p>java code:</p>
  
  <pre><code>HttpURLConnection connection = (HttpURLConnection) url.openConnection();
  connection.setDoOutput(true);
  connection.setDoInput(true);
  connection.setInstanceFollowRedirects(false);
  connection.setRequestMethod("POST");
  connection.setRequestProperty("category_name", categoryName);
  connection.setRequestProperty("complete", complete);
  
  DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
  connection.getResponseCode();
  
  wr.flush();
  wr.close();
  connection.disconnect();
  </code></pre>