1
安全なウェブページのデータを読んでみたいです。https://www.paypal.comと言うと、私はプロキシの背後にいます。私はhttpsウェブページのデータをプロキシの背後にあるJava
System.setProperty("java.net.useSystemProxies","true");
System.setProperty("htttps.proxyHost","myproxyhost");
System.setProperty("https.proxyPort","443");
URL u = new URL("https://www.paypal.com");
URLConnection uc = u.openConnection();
uc.setDoOutput(true);
StringBuffer sbuf=new StringBuffer();
BufferedReader in = new BufferedReader(
new InputStreamReader(uc.getInputStream()));
String res = in.readLine();
System.out.println(" Response from paypal "+res);
while ((res = in.readLine()) != null){
sbuf.append(res).append(",");
}
in.close();
System.out.println(" Total Data received "+sbuf);
で試してみました私はUnknownHostExceptionがすべての時間を取得しています、私は成功したHTTPのウェブサイトとデータをフェッチしています。何か不足していますか?
おかげで、 のRohit
良いキャッチ。 ___ –