ZstdHttpCompressor
Hierarchy
- HttpCompressor
- ZstdHttpCompressor
Index
Methods
Properties
Methods
__init__
Initialize the zstd compressor.
Parameters
optionalkeyword-onlyquality: int = 3
Compression level, from the fastest to the best compression. zstd's levels 20 to 22 are not accepted: their window exceeds the 8 MB that HTTP decoders are required to support.
Returns None
compress
Compress a request body.
Parameters
data: bytes
The raw bytes to compress.
Returns bytes
The compressed bytes.
Properties
content_encoding
Value sent in the Content-Encoding header, for example gzip or br.
Compresses request bodies using zstd.
Uses the standard library
compression.zstdmodule on Python 3.14 and newer, provided the Python build includes it. On older versions it requires thezstdextra:pip install "apify-client[zstd]".