Here you can find the source of createConnection(String processorName, String baseUrl)
private static HttpURLConnection createConnection(String processorName, String baseUrl) throws Exception
//package com.java2s; //License from project: Open Source License import java.net.HttpURLConnection; import java.net.URL; public class Main { private static HttpURLConnection createConnection(String processorName, String baseUrl) throws Exception { HttpURLConnection connection = (HttpURLConnection) new URL(baseUrl + "api/process/" + processorName) .openConnection();// ww w . ja v a 2 s. co m connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "application/json"); return connection; } }