httpClient 进行get请求

 1         String url = baseUrl;
 2         logger.info("checkIfTheFolderIsExist");
 3         CloseableHttpClient httpClient = HttpClientBuilder.create().build();
 4         URI uri = new URIBuilder()
 5                 .setPath(url)
 6                 .setParameter("token", token)
 7                 .setParameter("folderName", folderName)
 8                 .setParameter("folderId", folderId)
 9                 .build();
10         HttpGet get = new HttpGet(uri);
11         CloseableHttpResponse response = httpClient.execute(get);
12         logger.info(EntityUtils.toString(response.getEntity(), "utf-8"));        

可参考 https://blog.csdn.net/justry_deng/article/details/81042379 

https://www.cnblogs.com/Vdiao/p/5339487.html

原文地址:https://www.cnblogs.com/yangxiaobo-blog/p/11547825.html