How do you set the protocol version on a CloseableHttpClient object or HttpPost object with http client 4.3 now that setParams and getParams are deprecated?
2 Answers
HttpPost post = new HttpPost("/");
post.setProtocolVersion(HttpVersion.HTTP_1_1);
1 Comment
Accountant م
httpClient version 5 has
setVersion functionor use that builder pattern they are so fond of these days:
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()
1 Comment
shmosel
Odd thing to be snide about