67,513
社区成员
发帖
与我相关
我的任务
分享
private void testIt1(){
URL url;
try {
url = new URL("https://www.alipay.com/index.html");
HttpsURLConnection con = (HttpsURLConnection)url.openConnection();
//dump all the content
if(con!=null){
System.out.println("****** Content of the URL ********");
BufferedReader br =new BufferedReader(new InputStreamReader(con.getInputStream()));
String input;
while ((input = br.readLine()) != null){
System.out.println(input);
}
br.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}