How to post JSON data using HttpURLConnection? I am trying this:
HttpURLConnection httpcon = (HttpURLConnection) ((new URL(\"a url\").openConnection())); htt
You may want to use the OutputStreamWriter class.
final String toWriteOut = "{'value': 7.5}"; final OutputStreamWriter osw = new OutputStreamWriter(connection.getOutputStream()); osw.write(toWriteOut); osw.close();