2
如何设置协议版本在具有http客户端4.3的CloseableHttpClient对象或HttpPost对象上,现在setParams和getParams已被弃用?apache http client 4.3 - 如何设置协议版本
如何设置协议版本在具有http客户端4.3的CloseableHttpClient对象或HttpPost对象上,现在setParams和getParams已被弃用?apache http client 4.3 - 如何设置协议版本
HttpPost post = new HttpPost("/");
post.setProtocolVersion(HttpVersion.HTTP_1_1);
,或者使用生成器模式,他们是如此喜欢这些天:
final HttpUriRequest request = RequestBuilder.post()
.setVersion(HttpVersion.HTTP_1_1)
.setUri(requestURI)
.addHeader(key, value)
.... <whaterver more you want to add to the request>
.build()