日期:2014-05-20 浏览次数:20700 次
URL postUrl = new URL(
"http://code.bankrate.com.cn/getProductData/financing_128951?pos=detail");
HttpURLConnection connection = (HttpURLConnection) postUrl
.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("referer", "http://www.bankrate.com.cn");
connection.connect();
BufferedReader reader = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while ((line = reader.readLine()) != null) {
System.out.println(line);
}
reader.close();
connection.disconnect();