Http的操作(不传递参数)

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();
}
上一篇:odoo10 addon开发流程


下一篇:Epoll模型