集册 Java实例教程 获取Https URL连接

获取Https URL连接

欢马劈雪     最近更新时间:2020-01-02 10:19:05

442
获取Https URL连接


//package com.nowjava;
/* 
 来自 
*N o w J a v a . c o m - 时代Java*/


import java.io.IOException;


import java.net.URL;


import javax.net.ssl.HttpsURLConnection;


public class Main {

    public static void main(String[] argv) throws Exception {

        String strUrl = "nowjava.com";

        System.out.println(getHttpsURLConnection(strUrl));

    }
/*nowjava 提供*/

    public static HttpsURLConnection getHttpsURLConnection(String strUrl)

            throws IOException {

        URL url = new URL(strUrl);

        
展开阅读全文