Java URLConnection Create createConnection(String processorName, String baseUrl)

Here you can find the source of createConnection(String processorName, String baseUrl)

Description

create Connection

License

Open Source License

Declaration

private static HttpURLConnection createConnection(String processorName, String baseUrl) throws Exception 

Method Source Code

//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;
    }
}

Related

  1. createConnection(final URL url, final String authValue)
  2. createConnection(String method, String destinationUrl)
  3. createConnection(URL url)
  4. createConnection(URL url)
  5. createConnection(URL url)
  6. createConnection(URL url, Proxy proxy)