title: How can I send POST parameters with HttpURLConnection POST in java?
body: <p>I am not familiar with https requests so please take it easy on me.
  I want to make a post call and retrieve a token for a url. The url is something like:
  /auth/token?param1=value1&amp;param2=value2&amp;param3=value3&amp;param4={{value4}}&amp;param5={{value5}}</p>
  <p>I make the post</p>
  <pre><code>    HttpURLConnection conn = (HttpURLConnection) authentication.openConnection();
      conn.setDoOutput(true);
      conn.setRequestProperty(&quot;Content-Type&quot;, &quot;application/x-www-form-urlencoded&quot;);
      conn.setRequestMethod(&quot;POST&quot;);
  </code></pre>
  <p>but in order to get the response I have to send the parameters.
  I've tried to write the url params as string to the connection outputstream but it doesnt work.</p>
  <p>Any help is appreciated.</p>