12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
网络知识 时间:2024-11-20 12:07:42
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
使用java访问https,具体方法如下:URL reqURL = new URL("https://www.baidu.com" ); //创建URL对象HttpsURLConnection httpsConn = (HttpsURLConnection)reqURL.openConnecti
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
使用java访问https,具体方法如下:
URL reqURL = new URL("https://www.baidu.com" ); //创建URL对象
HttpsURLConnection httpsConn = (HttpsURLConnection)reqURL.openConnection();
//取得该连接的输入流,以读取响应内容
InputStreamReader insr = new InputStreamReader(httpsConn.getInputStream();
//读取服务器的响应内容并显示
int respInt = insr.read();
while( respInt != -1){
System.out.print((char)respInt);
respInt = insr.read();
}
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19