title: How can I use java to send HTTP post request of a JSON array of strings?
body: <p>I'm trying to implement the http post request to specified in the link: <a href="http://sentiment.vivekn.com/docs/api/" rel="nofollow noreferrer">Click here for the link.</a>
  How can I do so with Java? </p>
  
  <pre><code>String url = "http://sentiment.vivekn.com/api/text/";
  URL obj = new URL(url);
  HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
  con.setRequestMethod("POST");
  con.setRequestProperty("User-Agent", USER_AGENT);
  con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
  
  String urlParameters = "Text to classify";
  
  // Send post request
  con.setDoOutput(true);
  DataOutputStream wr = new DataOutputStream(con.getOutputStream());
  wr.writeBytes(urlParameters);
  wr.flush();
  wr.close();
  </code></pre>
  
  <p>How do I modify this as to send a JSON array of texts as described in the link and retrieve the results? </p>