Here you can find the source of sendJsonData(final HttpURLConnection connection, final String data)
private static void sendJsonData(final HttpURLConnection connection, final String data) throws IOException
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); // import java.io.IOException; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; public class Main { private static void sendJsonData(final HttpURLConnection connection, final String data) throws IOException { new OutputStreamWriter(connection.getOutputStream()).append(data).flush(); }//from w w w . ja v a 2 s .co m }