Response Body Encoding / Decoding
If you are specifying accept-encoding
header yourself and you are on a http1
connection than you have to take care of the response body decompression yourself. It is not done automatically.
Only if you are not adding accept-encoding
header then the library adds it for you if not explicit disabled and also handles the decompression automatically.
On http2
the automatic decompression should always be in place according to the content-type
Header on the Response.
DecompressBody
is an exported function you can use. See the following example on how do decompress the response body manually
It is possible to disable the automatic decompression on http2 by adding the following option to the http client
Shared Library & Standalone API
When you are using the shared library or standalone api application the response body will always be decompressed.
Last updated