Java HttpURLConnection Open openConnection(final String urlString)

Here you can find the source of openConnection(final String urlString)

Description

open Connection

License

Apache License

Declaration

private static HttpURLConnection openConnection(final String urlString) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    private static HttpURLConnection openConnection(final String urlString) throws Exception {

        final URL url = new URL(urlString);
        final HttpURLConnection connection = (HttpURLConnection) url.openConnection();

        return connection;
    }//from w  w w.  ja  v  a  2s  .  co m
}

Related

  1. getConnection(String url)
  2. getConnection(String urlStr, boolean useProxy)
  3. getConnection(URL url)
  4. getConnectionCharset(HttpURLConnection connection)
  5. getConnectionStream(HttpURLConnection con)
  6. openConnection(final URL url, final String requestMethod)
  7. openConnection(String url, String method, String contentType, String ssic)
  8. openConnection(URL url, Proxy proxy)
  9. openConnectionCheckRedirects(URLConnection c)