Version: 3.1On this pageHttpCompressor 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.HierarchyHttpCompressorBrotliHttpCompressorGzipHttpCompressorIndex MethodscompressPropertiescontent_encodingMethods compress compress(data): bytesCompress a request body.Parametersdata: bytesThe raw bytes to compress.Returns bytesThe compressed bytes.Properties content_encodingcontent_encoding: strValue sent in the Content-Encoding header, for example gzip or br.
Strategy for compressing HTTP request bodies.
Extend this class to create a custom compressor. Set
content_encodingto the value that should be sent in theContent-Encodingheader and implementcompress.