ttpResponse httpResponse = null;
HttpEntity httpEntity = null;
HttpGet httpGet = new HttpGet("http://www.baidu.com");
HttpClient httpClient = new DefaultHttpClient();
InputStream inputStream = null;
httpResponse = httpClient.execute(httpGet);
httpEntity = httpResponse.getEntity();
inputStream = httpEntity.getContent();
BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
String result = null;
String line = null;
result = result + line;
System.out.println(result);
}
e.printStackTrace();
inputStream.close();
e.printStackTrace();
}
时间: 2024-11-05 11:49:57