httpClent基本使用方法

来源:互联网 发布:搜狗输入法添加到mac 编辑:程序博客网 时间:2024/06/14 07:37
CloseableHttpClient httpclient = HttpClients.createDefault();  HttpGet httpget = new HttpGet("http://localhost/");  CloseableHttpResponse response = httpclient.execute(httpget);  try {      <...>  } finally {      response.close();  }