Unirest automatically deflates gzipped responses but does not remove the content-encoding header to reflect that the response is no longer zipped:
@Test
public void testGzipAsync() throws Exception {
HttpResponse<RequestCapture> resp = Unirest.get(MockServer.GZIP)
.queryString("zipme", "up")
.asObjectAsync(RequestCapture.class)
.get();
resp.getBody()
.assertParam("zipme", "up")
.assertRequestHeader("Accept-Encoding", "gzip");
assertEquals(0, resp.getHeaders().get("Content-Encoding").size());
}
See #295
Unirest automatically deflates gzipped responses but does not remove the content-encoding header to reflect that the response is no longer zipped: