MCPcopy
hub / github.com/encode/httpx / compress

Function compress

tests/test_decoders.py:190–192  ·  view source on GitHub ↗
(body: bytes)

Source from the content-addressed store, hash-verified

188 compressor = zlib.compressobj(9, zlib.DEFLATED, zlib.MAX_WBITS | 16)
189
190 async def compress(body: bytes) -> typing.AsyncIterator[bytes]:
191 yield compressor.compress(body)
192 yield compressor.flush()
193
194 headers = [(b"Content-Encoding", b"gzip")]
195 response = httpx.Response(

Callers 1

test_streamingFunction · 0.85

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected