ContentDecoder

#SoupContentDecoder 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.

If you are using a plain #SoupSession (ie, not #SoupSessionAsync or #SoupSessionSync), then a #SoupContentDecoder will automatically be added to the session by default. (You can use %SOUP_SESSION_REMOVE_FEATURE_BY_TYPE at construct time if you don't want this.) If you are using one of the deprecated #SoupSession subclasses, you can add a #SoupContentDecoder to your session with soup_session_add_feature() or soup_session_add_feature_by_type().

If #SoupContentDecoder successfully decodes the Content-Encoding, it will set the %SOUP_MESSAGE_CONTENT_DECODED flag on the message, and the message body and the chunks in the #SoupMessage::got_chunk signals 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 #SoupContentDecoder doesn't recognize, then none of the encodings will be decoded (and the %SOUP_MESSAGE_CONTENT_DECODED flag will not be set).

(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.)

Constructors

this
this(SoupContentDecoder* soupContentDecoder, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

getContentDecoderStruct
SoupContentDecoder* getContentDecoderStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

Mixins

__anonymous
mixin SessionFeatureT!(SoupContentDecoder)
Undocumented in source.

Static functions

getType
GType getType()

Variables

soupContentDecoder
SoupContentDecoder* soupContentDecoder;

the main Gtk struct

Inherited Members

From SessionFeatureIF

getSessionFeatureStruct
SoupSessionFeature* getSessionFeatureStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
addFeature
bool addFeature(GType type)

Adds a "sub-feature" of type @type to the base feature @feature. This is used for features that can be extended with multiple different types. Eg, the authentication manager can be extended with subtypes of #SoupAuth.

attach
void attach(Session session)
detach
void detach(Session session)
hasFeature
bool hasFeature(GType type)

Tests if @feature has a "sub-feature" of type @type. See soup_session_feature_add_feature().

removeFeature
bool removeFeature(GType type)

Removes the "sub-feature" of type @type from the base feature @feature. See soup_session_feature_add_feature().

Meta

Since

2.30