运维开发网
广告位招商联系QQ:123077622
 
广告位招商联系QQ:123077622

httpClient 进行get请求

运维开发网 https://www.qedev.com 2020-07-21 13:01 出处:网络 作者:运维开发网整理
1 String url = baseUrl; 2 logger.info("checkIfTheFolderIsExist"); 3 CloseableHttpClient httpClient = HttpClientBuilder.create().build(); 4 URI uri = new URIBuilde
 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 

扫码领视频副本.gif

0

精彩评论

暂无评论...
验证码 换一张
取 消