httpclientutil
httpclientutil copied to clipboard
该项目基于HttpClient-4.4.1封装的一个工具类。提供了更为简单的GET、POST及上传下载等功能。同时支持插件式配置Http-Header(包含自定义header)、配置SSL和Proxy等。
302重定向报错
向一个网址发送post请求后,然后网址返回302重定向,我想获取重定向的locations,获取到的是:不支持此消息类型,看不到我想要的东西,这一点怎么解决?
HttpDelete没有setEntity方法,需要做下补充 可以参考:https://blog.csdn.net/HaleyLiu123/article/details/81303508
HttpConfig config =HttpConfig.custom().url(url) .map(map) .method(HttpMethods.GET); map传参为什么后端接收不到参数。
[](https://medium.com/@jonathan.leitschuh/want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-1fc329d898fb?source=friends_link&sk=3c99970c55a899ad9ef41f126efcde0e) - [Want to take over the Java ecosystem? All you need is a MITM!](https://medium.com/@jonathan.leitschuh/want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-1fc329d898fb?source=friends_link&sk=3c99970c55a899ad9ef41f126efcde0e) - [Update: Want to take over the Java ecosystem? All you need is a MITM!](https://medium.com/bugbountywriteup/update-want-to-take-over-the-java-ecosystem-all-you-need-is-a-mitm-d069d253fe23?source=friends_link&sk=8c8e52a7d57b98d0b7e541665688b454)...
需要先设置SSLProtocolVersion再pool,否则注释掉“最简单的使用:”下面那两行再跑会报错javax.net.ssl.SSLException: Received fatal alert: protocol_version
1、HttpConfig 相关的map、url,去掉ThreadLocal相关的线程同步变量,改为局部变量; 2、优化日志打印功能,默认为打印,并改为logback的jar; 3、httpClient改为4.5.6的版本;
code review
如果我本地已经获取到了cookies,如何根据cookies来访问登陆的网站。 HttpConfig里面的context和header都设置过了,返回的仍然是没有登陆过的页面