Go to the latest version of this document.

# ``twisted`.`web`.`server`.`_GzipEncoder``

class documentation

`class _GzipEncoder: (source)`

Constructor: `_GzipEncoder(compressLevel, request)`

Implements interfaces: `twisted.web.iweb._IRequestEncoder`

View In Hierarchy

An encoder which supports gzip.

Present Since
12.3

Method | `__init__` | Undocumented
Method | `encode` | Write to the request, automatically compressing data on the fly.
Method | `finish` | Finish handling the request request, flushing any data from the zlib buffer.
Instance Variable | `_request` | A reference to the originating request.
Instance Variable | `_zlibCompressor` | The zlib compressor instance used to compress the stream.

def __init__(self, compressLevel, request): (source)

Undocumented

def encode(self, data): (source)
from `twisted.web.iweb._IRequestEncoder`

Write to the request, automatically compressing data on the fly.

def finish(self): (source)
from `twisted.web.iweb._IRequestEncoder`

Finish handling the request request, flushing any data from the zlib buffer.

_request = (source)

A reference to the originating request.

_zlibCompressor = (source)

The zlib compressor instance used to compress the stream.