Exception in thread "main" com.arronlong.httpclientutil.exception.HttpProcessException: javax.net.ssl.SSLException: Received fatal alert: protocol_version
at com.arronlong.httpclientutil.HttpClientUtil.execute(HttpClientUtil.java:462)
at com.arronlong.httpclientutil.HttpClientUtil.send(HttpClientUtil.java:377)
at com.arronlong.httpclientutil.HttpClientUtil.post(HttpClientUtil.java:128)
at com.github.binarywang.demo.wx.mp.utils.HttpRequestUtilsTest.main(HttpRequestUtilsTest.java:60)
Caused by: javax.net.ssl.SSLException: Received fatal alert: protocol_version
HttpClient client = hcb.build();
Map<String, Object> map = new HashMap<String, Object>();
map.put("key1", "value1");
map.put("key2", "value2");
//插件式配置请求参数(网址、请求参数、编码、client)
HttpConfig config = HttpConfig.custom()
.timeout(1000) //超时
.url(url) //设置请求的url
//使用方式:
String result2 = HttpClientUtil.post(config); //post请求
System.out.println(result2);