class documentation

class twisted.web.client.ContentDecoderAgent: (source)

Implements interfaces: twisted.web.iweb.IAgent

View In Hierarchy

An Agent wrapper to handle encoded content.

It takes care of declaring the support for content in the Accept-Encoding header and automatically decompresses the received data if the Content-Encoding header indicates a supported encoding.

For example:

    agent = ContentDecoderAgent(Agent(reactor),
                                [(b'gzip', GzipDecoder)])
ParametersagentThe agent to wrap
decodersA sequence of (name, decoder) objects. The name declares which encoding the decoder supports. The decoder must accept an IResponse and return an IResponse when called. The order determines how the decoders are advertised to the server. Names must be unique.not be duplicated.
See AlsoGzipDecoder
Present Since11.1
Method __init__ Undocumented
Method request Send a client request which declares supporting compressed content.
Instance Variable _agent Undocumented
Instance Variable _decoders Undocumented
Instance Variable _supported Undocumented
Method _handleResponse Check if the response is encoded, and wrap it to handle decompression.
def __init__(self, agent, decoders): (source)

Undocumented

_agent = (source)

Undocumented

_decoders = (source)

Undocumented

_supported = (source)

Undocumented

def request(self, method, uri, headers=None, bodyProducer=None): (source)

Send a client request which declares supporting compressed content.

See AlsoAgent.request.
def _handleResponse(self, response): (source)

Check if the response is encoded, and wrap it to handle decompression.

API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.