gi-soup-2.4.24: Libsoup bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Soup.Objects.ContentDecoder

Description

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.

If you are using a plain Session (ie, not SessionAsync or SessionSync), then a ContentDecoder 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 Session subclasses, you can add a ContentDecoder to your session with sessionAddFeature or sessionAddFeatureByType.

If ContentDecoder successfully decodes the Content-Encoding, it will set the MessageFlagsContentDecoded flag on the message, and the message body and the chunks in the Message::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 ContentDecoder doesn't recognize, then none of the encodings will be decoded (and the MessageFlagsContentDecoded 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.)

Since: 2.30

Synopsis

Exported types

newtype ContentDecoder Source #

Memory-managed wrapper type.

Constructors

ContentDecoder (ManagedPtr ContentDecoder) 

Instances

Instances details
Eq ContentDecoder Source # 
Instance details

Defined in GI.Soup.Objects.ContentDecoder

GObject ContentDecoder Source # 
Instance details

Defined in GI.Soup.Objects.ContentDecoder

ManagedPtrNewtype ContentDecoder Source # 
Instance details

Defined in GI.Soup.Objects.ContentDecoder

TypedObject ContentDecoder Source # 
Instance details

Defined in GI.Soup.Objects.ContentDecoder

Methods

glibType :: IO GType

HasParentTypes ContentDecoder Source # 
Instance details

Defined in GI.Soup.Objects.ContentDecoder

IsGValue (Maybe ContentDecoder) Source #

Convert ContentDecoder to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Soup.Objects.ContentDecoder

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ContentDecoder -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ContentDecoder)

type ParentTypes ContentDecoder Source # 
Instance details

Defined in GI.Soup.Objects.ContentDecoder

type ParentTypes ContentDecoder = '[Object, SessionFeature]

class (GObject o, IsDescendantOf ContentDecoder o) => IsContentDecoder o Source #

Type class for types which can be safely cast to ContentDecoder, for instance with toContentDecoder.

Instances

Instances details
(GObject o, IsDescendantOf ContentDecoder o) => IsContentDecoder o Source # 
Instance details

Defined in GI.Soup.Objects.ContentDecoder

toContentDecoder :: (MonadIO m, IsContentDecoder o) => o -> m ContentDecoder Source #

Cast to ContentDecoder, for types for which this is known to be safe. For general casts, use castTo.

Methods