CloseableHttpClient
时间: 2023-10-14 16:58:15 浏览: 73
CloseableHttpClient是HttpClient的子接口,它实现了HttpClient接口,具有HttpClient的优势。它可以实现自动关闭连接,通过实现Closeable接口的close方法来关闭连接池。同时,CloseableHttpClient可以构建多线程并发环境,可以创建多个实例来处理任务,并通过close方法关闭连接,释放资源。因此,CloseableHttpClient是一种发送HTTP请求的方式,可以用于发送Get和Post请求。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* *3* [【项目实战】为什么我选择使用CloseableHttpClient,而不是HttpClient,他们俩有什么区别?](https://blog.csdn.net/wstever/article/details/129282437)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [java发送http请求的两种方式:HTTPClient和CloseableHttpClient](https://blog.csdn.net/u014429653/article/details/106985970)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文