Closed m-emelchenkov closed 5 years ago
It's necessary to remove the code from unirest-java which adds the ACCEPT_ENCODING_HEADER and also call something like CloseableHttpClient client = HttpClientBuilder.create().disableContentCompression().build(), or this header will be added by Apache framework.
You can set custom HttpClient object with desired configuration in Unirest.setHttpClient public interface.
Hi! I don't think so because you have the code in HttpClientHelper.java
in function prepareRequest()
:
if (!request.getHeaders().containsKey(ACCEPT_ENCODING_HEADER)) {
request.header(ACCEPT_ENCODING_HEADER, "gzip");
}
It is always called, even for custom HttpClient, isn't it? Please excuse me if I wrong.
Sorry I should have checked. Reopening the issue But expect delayed resolution. Feel free to contribute to project with a PR :)
What the? Really? This is a blocker for me and I've wasted 3 hours on this library.
i've exposed a config option to turn off default compression. should get released later today
It's necessary to have an ability to remove ACCEPT_ENCODING_HEADER from request headers. If it is not set then it set its default value which is not acceptable for my use-case, where there should not be this header at all.