GZipHttpClient constructor

GZipHttpClient({
  1. Client? innerClient,
  2. int level = 6,
})

Gzip all incoming requests and mutate them so that the payload is encoded. Additionally, (over)writes the header {'Content-Encoding': 'gzip'}.

Implementation

GZipHttpClient({
  http.Client? innerClient,

  /// The higher the level, the smaller the output at the expense of memory.
  /// Defaults to [GZipCodec]'s default `6`.
  int level = 6,
})  : innerClient = innerClient ?? http.Client(),
      _encoder = GZipCodec(level: level);