Skip to main content
Version: Next

HttpCompressor

Strategy for compressing HTTP request bodies.

Extend this class to create a custom compressor. Set content_encoding to the value that should be sent in the Content-Encoding header and implement compress.

Hierarchy

Index

Methods

Properties

Methods

compress

  • compress(data): bytes
  • Compress a request body.


    Parameters

    • data: bytes

      The raw bytes to compress.

    Returns bytes

    The compressed bytes.

Properties

content_encoding

content_encoding: str

Value sent in the Content-Encoding header, for example gzip or br.

Page Options