HttpClient使用小记
2019-08-06 本文已影响0人
一只狗被牵着走
前两天向同事提供了一段发送http请求的代码,今天他问我代码里面的含义,因为使用代码的时候主要以可用为主,没有过多研究意思。针对他的问题,查了资料、看了源码后,稍微理下:


最终回复的结果:

查阅资料:
1、通过apache的CloseableHttpClient的HttpClients.createDefault()实现忽略https安全证书认证问题的示例代码
2、 HttpEntity实体即可以使流也可以使字符串形式
3、HttpEntity的使用
4、closeableHttpClient用法