HttpPost post = new HttpPost("/");
post.setProtocolVersion(HttpVersion.HTTP_1_1);
apache http client 4.3 - how to set protocol version
-
11-10-2022 - |
Pregunta
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?
Solución
Otros consejos
or 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()
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow