title: How to POST parameters and body in HttpURLConnection
body: <p>How do I do both at the same time?</p>
  
  <p>The parameters are just query string parameters. The body is json. </p>
  
  <pre><code> connection.setRequestProperty("Content-Type", "application/json");
   connection.setRequestProperty("Accept", "application/json");
   connection.setDoOutput(true);
   connection.getOutputStream().write(parameters);
   connection.getOutputStream().write(sqlDatabase.toString().getBytes("UTF-8"));
  </code></pre>
  
  <p>sqlDatabase is a JsonObject, while parameters is just a byte[]; </p>