httpclient获取状态码(4.5.2版本)

来源:互联网 发布:电脑人工智能软件 编辑:程序博客网 时间:2024/04/30 05:35
CloseableHttpClient httpClient = HttpClients.createDefault();HttpGet httpGet = new HttpGet("http://www.baidu.com");try {    CloseableHttpResponse response = httpClient.execute(httpGet);    System.out.println(response.getStatusLine());} catch(Exception e){    e.printStackTrace();}
0 0