Soup.ContentDecoder

g GObject.GInterface GObject.GInterface Soup.SessionFeature Soup.SessionFeature GObject.GInterface->Soup.SessionFeature GObject.Object GObject.Object Soup.ContentDecoder Soup.ContentDecoder GObject.Object->Soup.ContentDecoder Soup.SessionFeature->Soup.ContentDecoder

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Soup.ContentDecoder(**kwargs)
Bases:

GObject.Object, Soup.SessionFeature

Abstract:

No

Structure:

Soup.ContentDecoderClass

Handles decoding of HTTP messages.

Soup.ContentDecoder handles adding the “Accept-Encoding” header on outgoing messages, and processing the “Content-Encoding” header on incoming ones. Currently it supports the “gzip”, “deflate”, and “br” content codings.

A Soup.ContentDecoder will automatically be added to the session by default. (You can use [method`Session`.remove_feature_by_type] if you don’t want this.)

If Soup.ContentDecoder successfully decodes the Content-Encoding, the message body will contain the decoded data; however, the message headers will be unchanged (and so “Content-Encoding” will still be present, “Content-Length” will describe the original encoded length, etc).

If “Content-Encoding” contains any encoding types that Soup.ContentDecoder doesn’t recognize, then none of the encodings will be decoded.

(Note that currently there is no way to (automatically) use Content-Encoding when sending a request body, or to pick specific encoding types to support.)