Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- contentSniffed
- disableFeature
- finished
- getAddress
- getFirstParty
- getFlags
- getHttpVersion
- getHttpsStatus
- getIsTopLevelNavigation
- getPriority
- getSiteForCookies
- getSoupRequest
- getUri
- gotBody
- gotChunk
- gotHeaders
- gotInformational
- isFeatureDisabled
- isKeepalive
- new
- newFromUri
- restarted
- setChunkAllocator
- setFirstParty
- setFlags
- setHttpVersion
- setIsTopLevelNavigation
- setPriority
- setRedirect
- setRequest
- setResponse
- setSiteForCookies
- setStatus
- setStatusFull
- setUri
- starting
- wroteBody
- wroteBodyData
- wroteChunk
- wroteHeaders
- wroteInformational
- Properties
- Signals
Represents an HTTP message being sent or received.
statusCode
will normally be a Status
value, eg,
StatusOk
, though of course it might actually be an unknown
status code. reasonPhrase
is the actual text returned from the
server, which may or may not correspond to the "standard"
description of statusCode
. At any rate, it is almost certainly
not localized, and not very descriptive even if it is in the user's
language; you should not use reasonPhrase
in user-visible
messages. Rather, you should look at statusCode
, and determine an
end-user-appropriate message based on that and on what you were
trying to do.
As described in the MessageBody
documentation, the
requestBody
and responseBody
<literal>data</literal> fields
will not necessarily be filled in at all times. When the body
fields are filled in, they will be terminated with a '\0' byte
(which is not included in the <literal>length</literal>), so you
can use them as ordinary C strings (assuming that you know that the
body doesn't have any other '\0' bytes).
For a client-side Message
, requestBody
's
<literal>data</literal> is usually filled in right before libsoup
writes the request to the network, but you should not count on
this; use messageBodyFlatten
if you want to ensure that
<literal>data</literal> is filled in. If you are not using
Request
to read the response, then responseBody
's
<literal>data</literal> will be filled in before
Message::finished is emitted. (If you are using Request
,
then the message body is not accumulated by default, so
responseBody
's <literal>data</literal> will always be Nothing
.)
For a server-side Message
, requestBody
's data
will be
filled in before Message
::got_body
is emitted.
To prevent the data
field from being filled in at all (eg, if you
are handling the data from a Message
::got_chunk
, and so don't
need to see it all at the end), call
messageBodySetAccumulate
on responseBody
or
requestBody
as appropriate, passing False
.
Synopsis
- newtype Message = Message (ManagedPtr Message)
- class (GObject o, IsDescendantOf Message o) => IsMessage o
- toMessage :: (MonadIO m, IsMessage o) => o -> m Message
- messageContentSniffed :: (HasCallStack, MonadIO m, IsMessage a) => a -> Text -> Map (Ptr ()) (Ptr ()) -> m ()
- messageDisableFeature :: (HasCallStack, MonadIO m, IsMessage a) => a -> GType -> m ()
- messageFinished :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageGetAddress :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Address
- messageGetFirstParty :: (HasCallStack, MonadIO m, IsMessage a) => a -> m URI
- messageGetFlags :: (HasCallStack, MonadIO m, IsMessage a) => a -> m [MessageFlags]
- messageGetHttpVersion :: (HasCallStack, MonadIO m, IsMessage a) => a -> m HTTPVersion
- messageGetHttpsStatus :: (HasCallStack, MonadIO m, IsMessage a) => a -> m (Bool, TlsCertificate, [TlsCertificateFlags])
- messageGetIsTopLevelNavigation :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Bool
- messageGetPriority :: (HasCallStack, MonadIO m, IsMessage a) => a -> m MessagePriority
- messageGetSiteForCookies :: (HasCallStack, MonadIO m, IsMessage a) => a -> m URI
- messageGetSoupRequest :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Request
- messageGetUri :: (HasCallStack, MonadIO m, IsMessage a) => a -> m URI
- messageGotBody :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageGotChunk :: (HasCallStack, MonadIO m, IsMessage a) => a -> Buffer -> m ()
- messageGotHeaders :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageGotInformational :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageIsFeatureDisabled :: (HasCallStack, MonadIO m, IsMessage a) => a -> GType -> m Bool
- messageIsKeepalive :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Bool
- messageNew :: (HasCallStack, MonadIO m) => Text -> Text -> m (Maybe Message)
- messageNewFromUri :: (HasCallStack, MonadIO m) => Text -> URI -> m Message
- messageRestarted :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageSetChunkAllocator :: (HasCallStack, MonadIO m, IsMessage a) => a -> ChunkAllocator -> m ()
- messageSetFirstParty :: (HasCallStack, MonadIO m, IsMessage a) => a -> URI -> m ()
- messageSetFlags :: (HasCallStack, MonadIO m, IsMessage a) => a -> [MessageFlags] -> m ()
- messageSetHttpVersion :: (HasCallStack, MonadIO m, IsMessage a) => a -> HTTPVersion -> m ()
- messageSetIsTopLevelNavigation :: (HasCallStack, MonadIO m, IsMessage a) => a -> Bool -> m ()
- messageSetPriority :: (HasCallStack, MonadIO m, IsMessage a) => a -> MessagePriority -> m ()
- messageSetRedirect :: (HasCallStack, MonadIO m, IsMessage a) => a -> Word32 -> Text -> m ()
- messageSetRequest :: (HasCallStack, MonadIO m, IsMessage a) => a -> Maybe Text -> MemoryUse -> Maybe ByteString -> m ()
- messageSetResponse :: (HasCallStack, MonadIO m, IsMessage a) => a -> Maybe Text -> MemoryUse -> Maybe ByteString -> m ()
- messageSetSiteForCookies :: (HasCallStack, MonadIO m, IsMessage a) => a -> Maybe URI -> m ()
- messageSetStatus :: (HasCallStack, MonadIO m, IsMessage a) => a -> Word32 -> m ()
- messageSetStatusFull :: (HasCallStack, MonadIO m, IsMessage a) => a -> Word32 -> Text -> m ()
- messageSetUri :: (HasCallStack, MonadIO m, IsMessage a) => a -> URI -> m ()
- messageStarting :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageWroteBody :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageWroteBodyData :: (HasCallStack, MonadIO m, IsMessage a) => a -> Buffer -> m ()
- messageWroteChunk :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageWroteHeaders :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- messageWroteInformational :: (HasCallStack, MonadIO m, IsMessage a) => a -> m ()
- constructMessageFirstParty :: (IsMessage o, MonadIO m) => URI -> m (GValueConstruct o)
- getMessageFirstParty :: (MonadIO m, IsMessage o) => o -> m URI
- setMessageFirstParty :: (MonadIO m, IsMessage o) => o -> URI -> m ()
- constructMessageFlags :: (IsMessage o, MonadIO m) => [MessageFlags] -> m (GValueConstruct o)
- getMessageFlags :: (MonadIO m, IsMessage o) => o -> m [MessageFlags]
- setMessageFlags :: (MonadIO m, IsMessage o) => o -> [MessageFlags] -> m ()
- constructMessageHttpVersion :: (IsMessage o, MonadIO m) => HTTPVersion -> m (GValueConstruct o)
- getMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> m HTTPVersion
- setMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> HTTPVersion -> m ()
- constructMessageIsTopLevelNavigation :: (IsMessage o, MonadIO m) => Bool -> m (GValueConstruct o)
- getMessageIsTopLevelNavigation :: (MonadIO m, IsMessage o) => o -> m Bool
- setMessageIsTopLevelNavigation :: (MonadIO m, IsMessage o) => o -> Bool -> m ()
- clearMessageMethod :: (MonadIO m, IsMessage o) => o -> m ()
- constructMessageMethod :: (IsMessage o, MonadIO m) => Text -> m (GValueConstruct o)
- getMessageMethod :: (MonadIO m, IsMessage o) => o -> m (Maybe Text)
- setMessageMethod :: (MonadIO m, IsMessage o) => o -> Text -> m ()
- constructMessagePriority :: (IsMessage o, MonadIO m) => MessagePriority -> m (GValueConstruct o)
- getMessagePriority :: (MonadIO m, IsMessage o) => o -> m MessagePriority
- setMessagePriority :: (MonadIO m, IsMessage o) => o -> MessagePriority -> m ()
- clearMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> m ()
- constructMessageReasonPhrase :: (IsMessage o, MonadIO m) => Text -> m (GValueConstruct o)
- getMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> m (Maybe Text)
- setMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> Text -> m ()
- getMessageRequestBody :: (MonadIO m, IsMessage o) => o -> m (Maybe MessageBody)
- getMessageRequestBodyData :: (MonadIO m, IsMessage o) => o -> m (Maybe Bytes)
- getMessageRequestHeaders :: (MonadIO m, IsMessage o) => o -> m (Maybe MessageHeaders)
- getMessageResponseBody :: (MonadIO m, IsMessage o) => o -> m (Maybe MessageBody)
- getMessageResponseBodyData :: (MonadIO m, IsMessage o) => o -> m (Maybe Bytes)
- getMessageResponseHeaders :: (MonadIO m, IsMessage o) => o -> m (Maybe MessageHeaders)
- constructMessageServerSide :: (IsMessage o, MonadIO m) => Bool -> m (GValueConstruct o)
- getMessageServerSide :: (MonadIO m, IsMessage o) => o -> m Bool
- clearMessageSiteForCookies :: (MonadIO m, IsMessage o) => o -> m ()
- constructMessageSiteForCookies :: (IsMessage o, MonadIO m) => URI -> m (GValueConstruct o)
- getMessageSiteForCookies :: (MonadIO m, IsMessage o) => o -> m URI
- setMessageSiteForCookies :: (MonadIO m, IsMessage o) => o -> URI -> m ()
- constructMessageStatusCode :: (IsMessage o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getMessageStatusCode :: (MonadIO m, IsMessage o) => o -> m Word32
- setMessageStatusCode :: (MonadIO m, IsMessage o) => o -> Word32 -> m ()
- clearMessageTlsCertificate :: (MonadIO m, IsMessage o) => o -> m ()
- constructMessageTlsCertificate :: (IsMessage o, MonadIO m, IsTlsCertificate a) => a -> m (GValueConstruct o)
- getMessageTlsCertificate :: (MonadIO m, IsMessage o) => o -> m (Maybe TlsCertificate)
- setMessageTlsCertificate :: (MonadIO m, IsMessage o, IsTlsCertificate a) => o -> a -> m ()
- constructMessageTlsErrors :: (IsMessage o, MonadIO m) => [TlsCertificateFlags] -> m (GValueConstruct o)
- getMessageTlsErrors :: (MonadIO m, IsMessage o) => o -> m [TlsCertificateFlags]
- setMessageTlsErrors :: (MonadIO m, IsMessage o) => o -> [TlsCertificateFlags] -> m ()
- constructMessageUri :: (IsMessage o, MonadIO m) => URI -> m (GValueConstruct o)
- getMessageUri :: (MonadIO m, IsMessage o) => o -> m URI
- setMessageUri :: (MonadIO m, IsMessage o) => o -> URI -> m ()
- type MessageContentSniffedCallback = Text -> Map Text Text -> IO ()
- afterMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageContentSniffedCallback) -> m SignalHandlerId
- onMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageContentSniffedCallback) -> m SignalHandlerId
- type MessageFinishedCallback = IO ()
- afterMessageFinished :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageFinishedCallback) -> m SignalHandlerId
- onMessageFinished :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageFinishedCallback) -> m SignalHandlerId
- type MessageGotBodyCallback = IO ()
- afterMessageGotBody :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotBodyCallback) -> m SignalHandlerId
- onMessageGotBody :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotBodyCallback) -> m SignalHandlerId
- type MessageGotChunkCallback = Buffer -> IO ()
- afterMessageGotChunk :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotChunkCallback) -> m SignalHandlerId
- onMessageGotChunk :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotChunkCallback) -> m SignalHandlerId
- type MessageGotHeadersCallback = IO ()
- afterMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotHeadersCallback) -> m SignalHandlerId
- onMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotHeadersCallback) -> m SignalHandlerId
- type MessageGotInformationalCallback = IO ()
- afterMessageGotInformational :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotInformationalCallback) -> m SignalHandlerId
- onMessageGotInformational :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotInformationalCallback) -> m SignalHandlerId
- type MessageNetworkEventCallback = SocketClientEvent -> IOStream -> IO ()
- afterMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageNetworkEventCallback) -> m SignalHandlerId
- onMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageNetworkEventCallback) -> m SignalHandlerId
- type MessageRestartedCallback = IO ()
- afterMessageRestarted :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRestartedCallback) -> m SignalHandlerId
- onMessageRestarted :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRestartedCallback) -> m SignalHandlerId
- type MessageStartingCallback = IO ()
- afterMessageStarting :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageStartingCallback) -> m SignalHandlerId
- onMessageStarting :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageStartingCallback) -> m SignalHandlerId
- type MessageWroteBodyCallback = IO ()
- afterMessageWroteBody :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyCallback) -> m SignalHandlerId
- onMessageWroteBody :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyCallback) -> m SignalHandlerId
- type MessageWroteBodyDataCallback = Buffer -> IO ()
- afterMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyDataCallback) -> m SignalHandlerId
- onMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyDataCallback) -> m SignalHandlerId
- type MessageWroteChunkCallback = IO ()
- afterMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteChunkCallback) -> m SignalHandlerId
- onMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteChunkCallback) -> m SignalHandlerId
- type MessageWroteHeadersCallback = IO ()
- afterMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteHeadersCallback) -> m SignalHandlerId
- onMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteHeadersCallback) -> m SignalHandlerId
- type MessageWroteInformationalCallback = IO ()
- afterMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteInformationalCallback) -> m SignalHandlerId
- onMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteInformationalCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Message Source # | |
GObject Message Source # | |
Defined in GI.Soup.Objects.Message | |
ManagedPtrNewtype Message Source # | |
Defined in GI.Soup.Objects.Message toManagedPtr :: Message -> ManagedPtr Message | |
TypedObject Message Source # | |
Defined in GI.Soup.Objects.Message | |
HasParentTypes Message Source # | |
Defined in GI.Soup.Objects.Message | |
IsGValue (Maybe Message) Source # | Convert |
Defined in GI.Soup.Objects.Message gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Message -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Message) | |
type ParentTypes Message Source # | |
Defined in GI.Soup.Objects.Message type ParentTypes Message = '[Object] |
class (GObject o, IsDescendantOf Message o) => IsMessage o Source #
Instances
(GObject o, IsDescendantOf Message o) => IsMessage o Source # | |
Defined in GI.Soup.Objects.Message |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, contentSniffed, disableFeature, finished, forceFloating, freezeNotify, getv, gotBody, gotChunk, gotHeaders, gotInformational, isFeatureDisabled, isFloating, isKeepalive, notify, notifyByPspec, ref, refSink, restarted, runDispose, starting, stealData, stealQdata, thawNotify, unref, watchClosure, wroteBody, wroteBodyData, wroteChunk, wroteHeaders, wroteInformational.
Getters
getAddress, getData, getFirstParty, getFlags, getHttpVersion, getHttpsStatus, getIsTopLevelNavigation, getPriority, getProperty, getQdata, getSiteForCookies, getSoupRequest, getUri.
Setters
setChunkAllocator, setData, setDataFull, setFirstParty, setFlags, setHttpVersion, setIsTopLevelNavigation, setPriority, setProperty, setRedirect, setRequest, setResponse, setSiteForCookies, setStatus, setStatusFull, setUri.
contentSniffed
messageContentSniffed :: (HasCallStack, MonadIO m, IsMessage a) => a -> Text -> Map (Ptr ()) (Ptr ()) -> m () Source #
No description available in the introspection data.
disableFeature
messageDisableFeature Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> GType |
|
-> m () |
This disables the actions of SessionFeature
s with the
given featureType
(or a subclass of that type) on msg
, so that
msg
is processed as though the feature(s) hadn't been added to the
session. Eg, passing SOUP_TYPE_CONTENT_SNIFFER
for featureType
will disable Content-Type sniffing on the message.
You must call this before queueing msg
on a session; calling it on
a message that has already been queued is undefined. In particular,
you cannot call this on a message that is being requeued after a
redirect or authentication.
Since: 2.28
finished
messageFinished :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
getAddress
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Address | Returns: the address |
Gets the address msg
's URI points to. After first setting the
URI on a message, this will be unresolved, although the message's
session will resolve it before sending the message.
Since: 2.26
getFirstParty
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m URI | Returns: the |
Gets msg
's first-party URI
Since: 2.30
getFlags
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m [MessageFlags] | Returns: the flags |
Gets the flags on msg
getHttpVersion
messageGetHttpVersion Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m HTTPVersion | Returns: the HTTP version |
Gets the HTTP version of msg
. This is the minimum of the
version from the request and the version from the response.
getHttpsStatus
messageGetHttpsStatus Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m (Bool, TlsCertificate, [TlsCertificateFlags]) |
If msg
is using https (or attempted to use https but got
StatusSslFailed
), this retrieves the TlsCertificate
associated with its connection, and the TlsCertificateFlags
showing what problems, if any, have been found with that
certificate.
<note><para>This is only meaningful with messages processed by a Session
and is
not useful for messages received by a Server
</para></note>
Since: 2.34
getIsTopLevelNavigation
messageGetIsTopLevelNavigation Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Bool |
No description available in the introspection data.
Since: 2.70
getPriority
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m MessagePriority | Returns: the priority of the message. |
Retrieves the MessagePriority
. If not set this value defaults
to SOUP_MESSAGE_PRIORITY_NORMAL
.
Since: 2.44
getSiteForCookies
messageGetSiteForCookies Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m URI | Returns: the |
Gets msg
's site for cookies URI
Since: 2.70
getSoupRequest
getUri
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m URI | Returns: the URI |
Gets msg
's URI
gotBody
messageGotBody :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
gotChunk
messageGotChunk :: (HasCallStack, MonadIO m, IsMessage a) => a -> Buffer -> m () Source #
No description available in the introspection data.
gotHeaders
messageGotHeaders :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
gotInformational
messageGotInformational :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
isFeatureDisabled
messageIsFeatureDisabled Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> GType |
|
-> m Bool |
Get whether SessionFeature
s of the given featureType
(or a subclass of that type) are disabled on msg
.
See messageDisableFeature
.
Since: 2.72
isKeepalive
Determines whether or not msg
's connection can be kept alive for
further requests after processing msg
, based on the HTTP version,
Connection header, etc.
new
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> m (Maybe Message) | Returns: the new |
Creates a new empty Message
, which will connect to uri
newFromUri
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> URI |
|
-> m Message | Returns: the new |
Creates a new empty Message
, which will connect to uri
restarted
messageRestarted :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
setChunkAllocator
messageSetChunkAllocator Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> ChunkAllocator |
|
-> m () |
Deprecated: Request
provides a much simpler API that lets youread the response directly into your own buffers without needing tomess with callbacks, pausing/unpausing, etc.
Sets an alternate chunk-allocation function to use when reading
msg
's body when using the traditional (ie,
non-tRequest
-based) API. Every time data is available
to read, libsoup will call allocator
, which should return a
Buffer
. (See ChunkAllocator
for additional details.)
Libsoup will then read data from the network into that buffer, and
update the buffer's <literal>length</literal> to indicate how much
data it read.
Generally, a custom chunk allocator would be used in conjunction
with messageBodySetAccumulate
False
and
Message
::got_chunk
, as part of a strategy to avoid unnecessary
copying of data. However, you cannot assume that every call to the
allocator will be followed by a call to your
Message
::got_chunk
handler; if an I/O error occurs, then the
buffer will be unreffed without ever having been used. If your
buffer-allocation strategy requires special cleanup, use
bufferNewWithOwner
rather than doing the cleanup from the
Message
::got_chunk
handler.
The other thing to remember when using non-accumulating message
bodies is that the buffer passed to the Message
::got_chunk
handler will be unreffed after the handler returns, just as it
would be in the non-custom-allocated case. If you want to hand the
chunk data off to some other part of your program to use later,
you'll need to ref the Buffer
(or its owner, in the
bufferNewWithOwner
case) to ensure that the data remains
valid.
setFirstParty
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> URI |
|
-> m () |
Sets firstParty
as the main document URI
for msg
. For
details of when and how this is used refer to the documentation for
CookieJarAcceptPolicy
.
Since: 2.30
setFlags
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> [MessageFlags] |
|
-> m () |
Sets the specified flags on msg
.
setHttpVersion
messageSetHttpVersion Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> HTTPVersion |
|
-> m () |
Sets the HTTP version on msg
. The default version is
HTTPVersionHttp11
. Setting it to HTTPVersionHttp10
will prevent certain
functionality from being used.
setIsTopLevelNavigation
messageSetIsTopLevelNavigation Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Bool |
|
-> m () |
See the same-site spec for more information.
Since: 2.70
setPriority
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> MessagePriority |
|
-> m () |
Sets the priority of a message. Note that this won't have any effect unless used before the message is added to the session's message processing queue.
The message will be placed just before any other previously added message with lower priority (messages with the same priority are processed on a FIFO basis).
Setting priorities does not currently work with SessionSync
(or with synchronous messages on a plain Session
) because in
the synchronous/blocking case, priority ends up being determined
semi-randomly by thread scheduling.
Since: 2.44
setRedirect
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> m () |
Sets msg
's status_code to statusCode
and adds a Location header
pointing to redirectUri
. Use this from a Server
when you
want to redirect the client to another URI.
redirectUri
can be a relative URI, in which case it is
interpreted relative to msg
's current URI. In particular, if
redirectUri
is just a path, it will replace the path
<emphasis>and query</emphasis> of msg
's URI.
Since: 2.38
setRequest
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Maybe Text |
|
-> MemoryUse |
|
-> Maybe ByteString |
|
-> m () |
setResponse
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Maybe Text |
|
-> MemoryUse |
|
-> Maybe ByteString |
|
-> m () |
setSiteForCookies
messageSetSiteForCookies Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Maybe URI |
|
-> m () |
Sets siteForCookies
as the policy URL for same-site cookies for msg
.
It is either the URL of the top-level document or Nothing
depending on whether the registrable
domain of this document's URL matches the registrable domain of its parent's/opener's
URL. For the top-level document it is set to the document's URL.
See the same-site spec for more information.
Since: 2.70
setStatus
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Word32 |
|
-> m () |
Sets msg
's status code to statusCode
. If statusCode
is a
known value, it will also set msg
's reason_phrase.
setStatusFull
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> m () |
Sets msg
's status code and reason phrase.
setUri
Sets msg
's URI to uri
. If msg
has already been sent and you want
to re-send it with the new URI, you need to call
sessionRequeueMessage
.
starting
messageStarting :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
wroteBody
messageWroteBody :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
wroteBodyData
messageWroteBodyData :: (HasCallStack, MonadIO m, IsMessage a) => a -> Buffer -> m () Source #
No description available in the introspection data.
wroteChunk
messageWroteChunk :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
wroteHeaders
messageWroteHeaders :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
wroteInformational
messageWroteInformational :: (HasCallStack, MonadIO m, IsMessage a) => a -> m () Source #
No description available in the introspection data.
Properties
firstParty
The URI
loaded in the application when the message was
queued.
Since: 2.30
constructMessageFirstParty :: (IsMessage o, MonadIO m) => URI -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “first-party
” property. This is rarely needed directly, but it is used by new
.
getMessageFirstParty :: (MonadIO m, IsMessage o) => o -> m URI Source #
Get the value of the “first-party
” property.
When overloading is enabled, this is equivalent to
get
message #firstParty
setMessageFirstParty :: (MonadIO m, IsMessage o) => o -> URI -> m () Source #
Set the value of the “first-party
” property.
When overloading is enabled, this is equivalent to
set
message [ #firstParty:=
value ]
flags
No description available in the introspection data.
constructMessageFlags :: (IsMessage o, MonadIO m) => [MessageFlags] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “flags
” property. This is rarely needed directly, but it is used by new
.
getMessageFlags :: (MonadIO m, IsMessage o) => o -> m [MessageFlags] Source #
Get the value of the “flags
” property.
When overloading is enabled, this is equivalent to
get
message #flags
setMessageFlags :: (MonadIO m, IsMessage o) => o -> [MessageFlags] -> m () Source #
Set the value of the “flags
” property.
When overloading is enabled, this is equivalent to
set
message [ #flags:=
value ]
httpVersion
No description available in the introspection data.
constructMessageHttpVersion :: (IsMessage o, MonadIO m) => HTTPVersion -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “http-version
” property. This is rarely needed directly, but it is used by new
.
getMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> m HTTPVersion Source #
Get the value of the “http-version
” property.
When overloading is enabled, this is equivalent to
get
message #httpVersion
setMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> HTTPVersion -> m () Source #
Set the value of the “http-version
” property.
When overloading is enabled, this is equivalent to
set
message [ #httpVersion:=
value ]
isTopLevelNavigation
Set when the message is navigating between top level domains.
Since: 2.70
constructMessageIsTopLevelNavigation :: (IsMessage o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “is-top-level-navigation
” property. This is rarely needed directly, but it is used by new
.
getMessageIsTopLevelNavigation :: (MonadIO m, IsMessage o) => o -> m Bool Source #
Get the value of the “is-top-level-navigation
” property.
When overloading is enabled, this is equivalent to
get
message #isTopLevelNavigation
setMessageIsTopLevelNavigation :: (MonadIO m, IsMessage o) => o -> Bool -> m () Source #
Set the value of the “is-top-level-navigation
” property.
When overloading is enabled, this is equivalent to
set
message [ #isTopLevelNavigation:=
value ]
method
No description available in the introspection data.
clearMessageMethod :: (MonadIO m, IsMessage o) => o -> m () Source #
Set the value of the “method
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#method
constructMessageMethod :: (IsMessage o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “method
” property. This is rarely needed directly, but it is used by new
.
getMessageMethod :: (MonadIO m, IsMessage o) => o -> m (Maybe Text) Source #
Get the value of the “method
” property.
When overloading is enabled, this is equivalent to
get
message #method
setMessageMethod :: (MonadIO m, IsMessage o) => o -> Text -> m () Source #
Set the value of the “method
” property.
When overloading is enabled, this is equivalent to
set
message [ #method:=
value ]
priority
No description available in the introspection data.
constructMessagePriority :: (IsMessage o, MonadIO m) => MessagePriority -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “priority
” property. This is rarely needed directly, but it is used by new
.
getMessagePriority :: (MonadIO m, IsMessage o) => o -> m MessagePriority Source #
Get the value of the “priority
” property.
When overloading is enabled, this is equivalent to
get
message #priority
setMessagePriority :: (MonadIO m, IsMessage o) => o -> MessagePriority -> m () Source #
Set the value of the “priority
” property.
When overloading is enabled, this is equivalent to
set
message [ #priority:=
value ]
reasonPhrase
No description available in the introspection data.
clearMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> m () Source #
Set the value of the “reason-phrase
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#reasonPhrase
constructMessageReasonPhrase :: (IsMessage o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “reason-phrase
” property. This is rarely needed directly, but it is used by new
.
getMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> m (Maybe Text) Source #
Get the value of the “reason-phrase
” property.
When overloading is enabled, this is equivalent to
get
message #reasonPhrase
setMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> Text -> m () Source #
Set the value of the “reason-phrase
” property.
When overloading is enabled, this is equivalent to
set
message [ #reasonPhrase:=
value ]
requestBody
No description available in the introspection data.
getMessageRequestBody :: (MonadIO m, IsMessage o) => o -> m (Maybe MessageBody) Source #
Get the value of the “request-body
” property.
When overloading is enabled, this is equivalent to
get
message #requestBody
requestBodyData
The message's HTTP request body, as a Bytes
.
Since: 2.46
getMessageRequestBodyData :: (MonadIO m, IsMessage o) => o -> m (Maybe Bytes) Source #
Get the value of the “request-body-data
” property.
When overloading is enabled, this is equivalent to
get
message #requestBodyData
requestHeaders
No description available in the introspection data.
getMessageRequestHeaders :: (MonadIO m, IsMessage o) => o -> m (Maybe MessageHeaders) Source #
Get the value of the “request-headers
” property.
When overloading is enabled, this is equivalent to
get
message #requestHeaders
responseBody
No description available in the introspection data.
getMessageResponseBody :: (MonadIO m, IsMessage o) => o -> m (Maybe MessageBody) Source #
Get the value of the “response-body
” property.
When overloading is enabled, this is equivalent to
get
message #responseBody
responseBodyData
The message's HTTP response body, as a Bytes
.
Since: 2.46
getMessageResponseBodyData :: (MonadIO m, IsMessage o) => o -> m (Maybe Bytes) Source #
Get the value of the “response-body-data
” property.
When overloading is enabled, this is equivalent to
get
message #responseBodyData
responseHeaders
No description available in the introspection data.
getMessageResponseHeaders :: (MonadIO m, IsMessage o) => o -> m (Maybe MessageHeaders) Source #
Get the value of the “response-headers
” property.
When overloading is enabled, this is equivalent to
get
message #responseHeaders
serverSide
No description available in the introspection data.
constructMessageServerSide :: (IsMessage o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “server-side
” property. This is rarely needed directly, but it is used by new
.
getMessageServerSide :: (MonadIO m, IsMessage o) => o -> m Bool Source #
Get the value of the “server-side
” property.
When overloading is enabled, this is equivalent to
get
message #serverSide
siteForCookies
No description available in the introspection data.
clearMessageSiteForCookies :: (MonadIO m, IsMessage o) => o -> m () Source #
Set the value of the “site-for-cookies
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#siteForCookies
constructMessageSiteForCookies :: (IsMessage o, MonadIO m) => URI -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “site-for-cookies
” property. This is rarely needed directly, but it is used by new
.
getMessageSiteForCookies :: (MonadIO m, IsMessage o) => o -> m URI Source #
Get the value of the “site-for-cookies
” property.
When overloading is enabled, this is equivalent to
get
message #siteForCookies
setMessageSiteForCookies :: (MonadIO m, IsMessage o) => o -> URI -> m () Source #
Set the value of the “site-for-cookies
” property.
When overloading is enabled, this is equivalent to
set
message [ #siteForCookies:=
value ]
statusCode
No description available in the introspection data.
constructMessageStatusCode :: (IsMessage o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “status-code
” property. This is rarely needed directly, but it is used by new
.
getMessageStatusCode :: (MonadIO m, IsMessage o) => o -> m Word32 Source #
Get the value of the “status-code
” property.
When overloading is enabled, this is equivalent to
get
message #statusCode
setMessageStatusCode :: (MonadIO m, IsMessage o) => o -> Word32 -> m () Source #
Set the value of the “status-code
” property.
When overloading is enabled, this is equivalent to
set
message [ #statusCode:=
value ]
tlsCertificate
The TlsCertificate
associated with the message
Since: 2.34
clearMessageTlsCertificate :: (MonadIO m, IsMessage o) => o -> m () Source #
Set the value of the “tls-certificate
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#tlsCertificate
constructMessageTlsCertificate :: (IsMessage o, MonadIO m, IsTlsCertificate a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “tls-certificate
” property. This is rarely needed directly, but it is used by new
.
getMessageTlsCertificate :: (MonadIO m, IsMessage o) => o -> m (Maybe TlsCertificate) Source #
Get the value of the “tls-certificate
” property.
When overloading is enabled, this is equivalent to
get
message #tlsCertificate
setMessageTlsCertificate :: (MonadIO m, IsMessage o, IsTlsCertificate a) => o -> a -> m () Source #
Set the value of the “tls-certificate
” property.
When overloading is enabled, this is equivalent to
set
message [ #tlsCertificate:=
value ]
tlsErrors
The verification errors on Message:tlsCertificate
Since: 2.34
constructMessageTlsErrors :: (IsMessage o, MonadIO m) => [TlsCertificateFlags] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “tls-errors
” property. This is rarely needed directly, but it is used by new
.
getMessageTlsErrors :: (MonadIO m, IsMessage o) => o -> m [TlsCertificateFlags] Source #
Get the value of the “tls-errors
” property.
When overloading is enabled, this is equivalent to
get
message #tlsErrors
setMessageTlsErrors :: (MonadIO m, IsMessage o) => o -> [TlsCertificateFlags] -> m () Source #
Set the value of the “tls-errors
” property.
When overloading is enabled, this is equivalent to
set
message [ #tlsErrors:=
value ]
uri
No description available in the introspection data.
constructMessageUri :: (IsMessage o, MonadIO m) => URI -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “uri
” property. This is rarely needed directly, but it is used by new
.
getMessageUri :: (MonadIO m, IsMessage o) => o -> m URI Source #
Get the value of the “uri
” property.
When overloading is enabled, this is equivalent to
get
message #uri
setMessageUri :: (MonadIO m, IsMessage o) => o -> URI -> m () Source #
Set the value of the “uri
” property.
When overloading is enabled, this is equivalent to
set
message [ #uri:=
value ]
Signals
contentSniffed
type MessageContentSniffedCallback Source #
= Text |
|
-> Map Text Text |
|
-> IO () |
This signal is emitted after Message::gotHeaders, and
before the first Message::gotChunk. If content
sniffing is disabled, or no content sniffing will be
performed, due to the sniffer deciding to trust the
Content-Type sent by the server, this signal is emitted
immediately after Message::gotHeaders, and type
is
Nothing
.
If the ContentSniffer
feature is enabled, and the
sniffer decided to perform sniffing, the first
Message::gotChunk emission may be delayed, so that the
sniffer has enough data to correctly sniff the content. It
notified the library user that the content has been
sniffed, and allows it to change the header contents in the
message, if desired.
After this signal is emitted, the data that was spooled so that sniffing could be done is delivered on the first emission of Message::gotChunk.
Since: 2.28
afterMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageContentSniffedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the contentSniffed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #contentSniffed callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageContentSniffedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the contentSniffed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #contentSniffed callback
finished
type MessageFinishedCallback = IO () Source #
afterMessageFinished :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageFinishedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the finished signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #finished callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageFinished :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageFinishedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the finished signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #finished callback
gotBody
type MessageGotBodyCallback = IO () Source #
Emitted after receiving the complete message body. (For a server-side message, this means it has received the request body. For a client-side message, this means it has received the response body and is nearly done with the message.)
See also soup_message_add_header_handler()
and
soup_message_add_status_code_handler()
, which can be used
to connect to a subset of emissions of this signal.
afterMessageGotBody :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotBodyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotBody signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #gotBody callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageGotBody :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotBodyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotBody signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #gotBody callback
gotChunk
type MessageGotChunkCallback Source #
Emitted after receiving a chunk of a message body. Note that "chunk" in this context means any subpiece of the body, not necessarily the specific HTTP 1.1 chunks sent by the other side.
If you cancel or requeue msg
while processing this signal,
then the current HTTP I/O will be stopped after this signal
emission finished, and msg
's connection will be closed.
afterMessageGotChunk :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotChunkCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotChunk signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #gotChunk callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageGotChunk :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotChunkCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotChunk signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #gotChunk callback
gotHeaders
type MessageGotHeadersCallback = IO () Source #
Emitted after receiving all message headers for a message. (For a client-side message, this is after receiving the Status-Line and response headers; for a server-side message, it is after receiving the Request-Line and request headers.)
See also soup_message_add_header_handler()
and
soup_message_add_status_code_handler()
, which can be used
to connect to a subset of emissions of this signal.
If you cancel or requeue msg
while processing this signal,
then the current HTTP I/O will be stopped after this signal
emission finished, and msg
's connection will be closed.
(If you need to requeue a message--eg, after handling
authentication or redirection--it is usually better to
requeue it from a Message
::got_body
handler rather
than a Message
::got_headers
handler, so that the
existing HTTP connection can be reused.)
afterMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotHeadersCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotHeaders signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #gotHeaders callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotHeadersCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotHeaders signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #gotHeaders callback
gotInformational
type MessageGotInformationalCallback = IO () Source #
Emitted after receiving a 1xx (Informational) response for a (client-side) message. The response_headers will be filled in with the headers associated with the informational response; however, those header values will be erased after this signal is done.
If you cancel or requeue msg
while processing this signal,
then the current HTTP I/O will be stopped after this signal
emission finished, and msg
's connection will be closed.
afterMessageGotInformational :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotInformationalCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotInformational signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #gotInformational callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageGotInformational :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotInformationalCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotInformational signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #gotInformational callback
networkEvent
type MessageNetworkEventCallback Source #
= SocketClientEvent |
|
-> IOStream |
|
-> IO () |
Emitted to indicate that some network-related event
related to msg
has occurred. This essentially proxies the
SocketClient::event signal, but only for events that
occur while msg
"owns" the connection; if msg
is sent on
an existing persistent connection, then this signal will
not be emitted. (If you want to force the message to be
sent on a new connection, set the
MessageFlagsNewConnection
flag on it.)
See SocketClient::event for more information on what
the different values of event
correspond to, and what
connection
will be in each case.
Since: 2.38
afterMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageNetworkEventCallback) -> m SignalHandlerId Source #
Connect a signal handler for the networkEvent signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #networkEvent callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageNetworkEventCallback) -> m SignalHandlerId Source #
Connect a signal handler for the networkEvent signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #networkEvent callback
restarted
type MessageRestartedCallback = IO () Source #
Emitted when a request that was already sent once is now being sent again (eg, because the first attempt received a redirection response, or because we needed to use authentication).
afterMessageRestarted :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRestartedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the restarted signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #restarted callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageRestarted :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRestartedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the restarted signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #restarted callback
starting
type MessageStartingCallback = IO () Source #
Emitted just before a message is sent.
Since: 2.50
afterMessageStarting :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageStartingCallback) -> m SignalHandlerId Source #
Connect a signal handler for the starting signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #starting callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageStarting :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageStartingCallback) -> m SignalHandlerId Source #
Connect a signal handler for the starting signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #starting callback
wroteBody
type MessageWroteBodyCallback = IO () Source #
Emitted immediately after writing the complete body for a message. (For a client-side message, this means that libsoup is done writing and is now waiting for the response from the server. For a server-side message, this means that libsoup has finished writing the response and is nearly done with the message.)
afterMessageWroteBody :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteBody signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #wroteBody callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageWroteBody :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteBody signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #wroteBody callback
wroteBodyData
type MessageWroteBodyDataCallback Source #
Emitted immediately after writing a portion of the message body to the network.
Unlike Message
::wrote_chunk
, this is emitted after
every successful write()
call, not only after finishing a
complete "chunk".
Since: 2.24
afterMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyDataCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteBodyData signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #wroteBodyData callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyDataCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteBodyData signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #wroteBodyData callback
wroteChunk
type MessageWroteChunkCallback = IO () Source #
Emitted immediately after writing a body chunk for a message.
Note that this signal is not parallel to
Message
::got_chunk
; it is emitted only when a complete
chunk (added with soup_message_body_append()
or
messageBodyAppendBuffer
) has been written. To get
more useful continuous progress information, use
Message
::wrote_body_data
.
afterMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteChunkCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteChunk signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #wroteChunk callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteChunkCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteChunk signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #wroteChunk callback
wroteHeaders
type MessageWroteHeadersCallback = IO () Source #
Emitted immediately after writing the headers for a message. (For a client-side message, this is after writing the request headers; for a server-side message, it is after writing the response headers.)
afterMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteHeadersCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteHeaders signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #wroteHeaders callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteHeadersCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteHeaders signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #wroteHeaders callback
wroteInformational
type MessageWroteInformationalCallback = IO () Source #
Emitted immediately after writing a 1xx (Informational) response for a (server-side) message.
afterMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteInformationalCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteInformational signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #wroteInformational callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteInformationalCallback) -> m SignalHandlerId Source #
Connect a signal handler for the wroteInformational signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #wroteInformational callback