TGRequestContent constructor

TGRequestContent(
  1. String? body,
  2. Map<String, String>? headers
)

Implementation

TGRequestContent(String? body, Map<String, String>? headers) {
  this.headers = headers;
  if (_isContentEncodingGZip(headers)) {
    List<int> compressed = GZipCodec().encode(utf8.encode(body!));
    this.headers?.addAll({'Content-Length': compressed.length.toString()});
    this.body = compressed;
  } else {
    this.body = body;
  }
}