Muhammad Reda created HTTPCLIENT-2071:
-----------------------------------------
Summary: No Content-Length or Content-Encoding headers for any
http response
Key: HTTPCLIENT-2071
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2071
Project: HttpComponents HttpClient
Issue Type: Bug
Components: HttpClient (classic)
Affects Versions: 5.0
Reporter: Muhammad Reda
HttpClient doesn't show to me the Content-Length or Content-Encoding headers of
the response, even thought the server is responding with them, for example this
code
{{}}
{code:java}
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet request = new HttpGet(new URI("https://www.example.com"));
CloseableHttpResponse response = httpclient.execute(request);
Header[] responseHeaders = response.getHeaders();
for(Header header: responseHeaders) {
System.out.println(header.getName());
}
{code}
{{}}
prints all the returned headers except the Content-Length or Content-Encoding
headers
Check these questions on stackoverflow.com
[https://stackoverflow.com/questions/61005981/apache-httpclient-is-not-showing-content-length-and-content-encoding-headers-of]
{{}}
[https://stackoverflow.com/questions/18726892/apache-httpclient-response-content-length-returns-1]
{{}}
{{}}
{{}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]