Skip to main content
Version: Next

BrotliHttpCompressor

Compresses request bodies using brotli.

Built on the node:zlib module, so it works wherever the client runs on Node.js.

Implements

import { ApifyClient, BrotliHttpCompressor } from 'apify-client';

const client = new ApifyClient({ token: 'my-token', compression: new BrotliHttpCompressor({ quality: 11 }) });

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

readonlycontentEncoding

contentEncoding: br = 'br'

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

Methods

compress

  • compress(data): Promise<Buffer<ArrayBufferLike>>
  • Compresses a request body.


    Parameters

    • data: Buffer<ArrayBufferLike>

      The raw bytes to compress.

    Returns Promise<Buffer<ArrayBufferLike>>

    The compressed bytes.

Page Options