Open
Description
So, should add Accept-Encoding: gzip,deflate
to request, then check for Content-Encoding: gzip
or Content-Encoding: deflate
and decompress body (after de-chunking).
Decompression may be done in single pass (zlib:gunzip/1
for gzip and zlib:unzip/1
for deflate) in case of synchronous requests and using streaming (zlib:open/0, zlib:inflateInit/1, zlib:inflate/2 ..., zlib:close/1
) in case of asynchronous.
Single-pass example can be found here https://github.com/seriyps/xhttpc/blob/master/src/middlewares/compression_middleware.erl
Some option should be added to enable this feature.