Code example for URLConnection

Methods: getOutputStream

0
        urlConnection.setDoOutput(true);
        return urlConnection;
    } 
 
    public static void write(final URLConnection urlConnection, final String data) throws IOException {
        IOUtils.write(urlConnection.getOutputStream(), data);
    } 
 
    public static String read(final URLConnection urlConnection) throws IOException {
        return IOUtils.read(urlConnection.getInputStream());
    } 
 
}