title: Passing Parameters with HttpURLConnection
body: <p>With the old Apache stuff deprecated in API 22, I am finally getting around to updating my network stuff.</p>
  
  <p>Using <code>openConnection()</code> seems pretty straight forward.  However, I have not seen any good example to send parameters with it.</p>
  
  <p>How would I update this code?</p>
  
  <pre><code>        ArrayList&lt;NameValuePair&gt; param = new ArrayList&lt;NameValuePair&gt;();
          param.add(new BasicNameValuePair("user_id",String.valueOf(userId)));
          httpPost.setEntity(new UrlEncodedFormEntity(param));
  </code></pre>
  
  <p>Now that <code>NameValuePair</code> and <code>BasicNameValuePair</code> are also deprecated.</p>
  
  <p>EDIT:  My server side <code>php</code> code doesn't expect JSON parameters and I can't all of the sudden switch due to existing users -- so a non-JSON answer is recommended.</p>
  
  <p>EDIT2:  I just need to Target Android 4.1+ at the moment.</p>