Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Invalid
-
5.0
-
None
-
None
-
Important
Description
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
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()); }
prints all the returned headers except the Content-Length or Content-Encoding headers
Check these questions on stackoverflow.com
https://stackoverflow.com/questions/18726892/apache-httpclient-response-content-length-returns-1