im trying to use HTTP/1.0 with Apache HttpClient 4.3, but I can't find out how. In 3.x version it was done this way:
httpClient.getParams().setParameter("http.protocol.version", HttpVersion.HTTP_1_0);
Thats deprecated by now. How to do it now? Thank you.
HTTP standards are developed by the Internet Engineering Task Force (IETF) and the World Wide Web Consortium (W3C), culminating in the publication of a series of Requests for Comments (RFCs). HTTP has four versions — HTTP/0.9, HTTP/1.0, HTTP/1.1, and HTTP/2.0.
CloseableHttpClient is an abstract class that represents a base implementation of the HttpClient interface. However, it also implements the Closeable interface. Thus, we should close all its instances after use.
HTTP version is sent as a header in every request, so it is set in the message sent by System. Net. Http.
HttpGet request = new HttpGet("/stuff");
request.setProtocolVersion(HttpVersion.HTTP_1_0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With