HttpCompressor
Implemented by
Index
Properties
Methods
Properties
readonlycontentEncoding
Value sent in the Content-Encoding header, for example gzip or br.
Methods
compress
Compresses a request body.
Parameters
data: Buffer<ArrayBufferLike>
The raw bytes to compress.
Returns Promise<Buffer<ArrayBufferLike>>
The compressed bytes.
Strategy for compressing HTTP request bodies.
Implement this interface to create a custom compressor. Set
contentEncodingto the value that should be sent in theContent-Encodingheader and implementcompress(). The client calls it only for bodies that are large enough to benefit from compression, whose content type does not already carry its own compression, and which the caller did not send with aContent-Encodingof their own.