Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype ContentDecoder = ContentDecoder (ManagedPtr ContentDecoder)
- class (GObject o, IsDescendantOf ContentDecoder o) => IsContentDecoder o
- toContentDecoder :: (MonadIO m, IsContentDecoder o) => o -> m ContentDecoder
Exported types
newtype ContentDecoder Source #
Memory-managed wrapper type.
ContentDecoder (ManagedPtr ContentDecoder) |
Instances
Eq ContentDecoder Source # | |
Defined in GI.Soup.Objects.ContentDecoder (==) :: ContentDecoder -> ContentDecoder -> Bool # (/=) :: ContentDecoder -> ContentDecoder -> Bool # | |
GObject ContentDecoder Source # | |
Defined in GI.Soup.Objects.ContentDecoder | |
ManagedPtrNewtype ContentDecoder Source # | |
Defined in GI.Soup.Objects.ContentDecoder toManagedPtr :: ContentDecoder -> ManagedPtr ContentDecoder | |
TypedObject ContentDecoder Source # | |
Defined in GI.Soup.Objects.ContentDecoder | |
HasParentTypes ContentDecoder Source # | |
Defined in GI.Soup.Objects.ContentDecoder | |
IsGValue (Maybe ContentDecoder) Source # | Convert |
Defined in GI.Soup.Objects.ContentDecoder gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ContentDecoder -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ContentDecoder) | |
type ParentTypes ContentDecoder Source # | |
Defined in GI.Soup.Objects.ContentDecoder |
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
(GObject o, IsDescendantOf ContentDecoder o) => IsContentDecoder o Source # | |
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
Click to display all available methods, including inherited ones
Methods
addFeature, attach, bindProperty, bindPropertyFull, detach, forceFloating, freezeNotify, getv, hasFeature, isFloating, notify, notifyByPspec, ref, refSink, removeFeature, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQdata.