Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- contentSniffed
- disableFeature
- finished
- getAddress
- getFirstParty
- getFlags
- getHttpVersion
- getHttpsStatus
- getPriority
- getSoupRequest
- getUri
- gotBody
- gotChunk
- gotHeaders
- gotInformational
- isKeepalive
- new
- newFromUri
- restarted
- setChunkAllocator
- setFirstParty
- setFlags
- setHttpVersion
- setPriority
- setRedirect
- setRequest
- setResponse
- 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
- noMessage :: Maybe 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])
- messageGetPriority :: (HasCallStack, MonadIO m, IsMessage a) => a -> m MessagePriority
- 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 ()
- 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 ()
- 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 ()
- 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 => URI -> IO (GValueConstruct o)
- getMessageFirstParty :: (MonadIO m, IsMessage o) => o -> m URI
- setMessageFirstParty :: (MonadIO m, IsMessage o) => o -> URI -> m ()
- constructMessageFlags :: IsMessage o => [MessageFlags] -> IO (GValueConstruct o)
- getMessageFlags :: (MonadIO m, IsMessage o) => o -> m [MessageFlags]
- setMessageFlags :: (MonadIO m, IsMessage o) => o -> [MessageFlags] -> m ()
- constructMessageHttpVersion :: IsMessage o => HTTPVersion -> IO (GValueConstruct o)
- getMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> m HTTPVersion
- setMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> HTTPVersion -> m ()
- clearMessageMethod :: (MonadIO m, IsMessage o) => o -> m ()
- constructMessageMethod :: IsMessage o => Text -> IO (GValueConstruct o)
- getMessageMethod :: (MonadIO m, IsMessage o) => o -> m (Maybe Text)
- setMessageMethod :: (MonadIO m, IsMessage o) => o -> Text -> m ()
- constructMessagePriority :: IsMessage o => MessagePriority -> IO (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 => Text -> IO (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 => Bool -> IO (GValueConstruct o)
- getMessageServerSide :: (MonadIO m, IsMessage o) => o -> m Bool
- constructMessageStatusCode :: IsMessage o => Word32 -> IO (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, IsTlsCertificate a) => a -> IO (GValueConstruct o)
- getMessageTlsCertificate :: (MonadIO m, IsMessage o) => o -> m (Maybe TlsCertificate)
- setMessageTlsCertificate :: (MonadIO m, IsMessage o, IsTlsCertificate a) => o -> a -> m ()
- constructMessageTlsErrors :: IsMessage o => [TlsCertificateFlags] -> IO (GValueConstruct o)
- getMessageTlsErrors :: (MonadIO m, IsMessage o) => o -> m [TlsCertificateFlags]
- setMessageTlsErrors :: (MonadIO m, IsMessage o) => o -> [TlsCertificateFlags] -> m ()
- constructMessageUri :: IsMessage o => URI -> IO (GValueConstruct o)
- getMessageUri :: (MonadIO m, IsMessage o) => o -> m URI
- setMessageUri :: (MonadIO m, IsMessage o) => o -> URI -> m ()
- type C_MessageContentSniffedCallback = Ptr () -> CString -> Ptr (GHashTable CString CString) -> Ptr () -> IO ()
- type MessageContentSniffedCallback = Text -> Map Text Text -> IO ()
- afterMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> MessageContentSniffedCallback -> m SignalHandlerId
- genClosure_MessageContentSniffed :: MonadIO m => MessageContentSniffedCallback -> m (GClosure C_MessageContentSniffedCallback)
- mk_MessageContentSniffedCallback :: C_MessageContentSniffedCallback -> IO (FunPtr C_MessageContentSniffedCallback)
- noMessageContentSniffedCallback :: Maybe MessageContentSniffedCallback
- onMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> MessageContentSniffedCallback -> m SignalHandlerId
- wrap_MessageContentSniffedCallback :: MessageContentSniffedCallback -> C_MessageContentSniffedCallback
- type C_MessageFinishedCallback = Ptr () -> Ptr () -> IO ()
- type MessageFinishedCallback = IO ()
- afterMessageFinished :: (IsMessage a, MonadIO m) => a -> MessageFinishedCallback -> m SignalHandlerId
- genClosure_MessageFinished :: MonadIO m => MessageFinishedCallback -> m (GClosure C_MessageFinishedCallback)
- mk_MessageFinishedCallback :: C_MessageFinishedCallback -> IO (FunPtr C_MessageFinishedCallback)
- noMessageFinishedCallback :: Maybe MessageFinishedCallback
- onMessageFinished :: (IsMessage a, MonadIO m) => a -> MessageFinishedCallback -> m SignalHandlerId
- wrap_MessageFinishedCallback :: MessageFinishedCallback -> C_MessageFinishedCallback
- type C_MessageGotBodyCallback = Ptr () -> Ptr () -> IO ()
- type MessageGotBodyCallback = IO ()
- afterMessageGotBody :: (IsMessage a, MonadIO m) => a -> MessageGotBodyCallback -> m SignalHandlerId
- genClosure_MessageGotBody :: MonadIO m => MessageGotBodyCallback -> m (GClosure C_MessageGotBodyCallback)
- mk_MessageGotBodyCallback :: C_MessageGotBodyCallback -> IO (FunPtr C_MessageGotBodyCallback)
- noMessageGotBodyCallback :: Maybe MessageGotBodyCallback
- onMessageGotBody :: (IsMessage a, MonadIO m) => a -> MessageGotBodyCallback -> m SignalHandlerId
- wrap_MessageGotBodyCallback :: MessageGotBodyCallback -> C_MessageGotBodyCallback
- type C_MessageGotChunkCallback = Ptr () -> Ptr Buffer -> Ptr () -> IO ()
- type MessageGotChunkCallback = Buffer -> IO ()
- afterMessageGotChunk :: (IsMessage a, MonadIO m) => a -> MessageGotChunkCallback -> m SignalHandlerId
- genClosure_MessageGotChunk :: MonadIO m => MessageGotChunkCallback -> m (GClosure C_MessageGotChunkCallback)
- mk_MessageGotChunkCallback :: C_MessageGotChunkCallback -> IO (FunPtr C_MessageGotChunkCallback)
- noMessageGotChunkCallback :: Maybe MessageGotChunkCallback
- onMessageGotChunk :: (IsMessage a, MonadIO m) => a -> MessageGotChunkCallback -> m SignalHandlerId
- wrap_MessageGotChunkCallback :: MessageGotChunkCallback -> C_MessageGotChunkCallback
- type C_MessageGotHeadersCallback = Ptr () -> Ptr () -> IO ()
- type MessageGotHeadersCallback = IO ()
- afterMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> MessageGotHeadersCallback -> m SignalHandlerId
- genClosure_MessageGotHeaders :: MonadIO m => MessageGotHeadersCallback -> m (GClosure C_MessageGotHeadersCallback)
- mk_MessageGotHeadersCallback :: C_MessageGotHeadersCallback -> IO (FunPtr C_MessageGotHeadersCallback)
- noMessageGotHeadersCallback :: Maybe MessageGotHeadersCallback
- onMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> MessageGotHeadersCallback -> m SignalHandlerId
- wrap_MessageGotHeadersCallback :: MessageGotHeadersCallback -> C_MessageGotHeadersCallback
- type C_MessageGotInformationalCallback = Ptr () -> Ptr () -> IO ()
- type MessageGotInformationalCallback = IO ()
- afterMessageGotInformational :: (IsMessage a, MonadIO m) => a -> MessageGotInformationalCallback -> m SignalHandlerId
- genClosure_MessageGotInformational :: MonadIO m => MessageGotInformationalCallback -> m (GClosure C_MessageGotInformationalCallback)
- mk_MessageGotInformationalCallback :: C_MessageGotInformationalCallback -> IO (FunPtr C_MessageGotInformationalCallback)
- noMessageGotInformationalCallback :: Maybe MessageGotInformationalCallback
- onMessageGotInformational :: (IsMessage a, MonadIO m) => a -> MessageGotInformationalCallback -> m SignalHandlerId
- wrap_MessageGotInformationalCallback :: MessageGotInformationalCallback -> C_MessageGotInformationalCallback
- type C_MessageNetworkEventCallback = Ptr () -> CUInt -> Ptr IOStream -> Ptr () -> IO ()
- type MessageNetworkEventCallback = SocketClientEvent -> IOStream -> IO ()
- afterMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> MessageNetworkEventCallback -> m SignalHandlerId
- genClosure_MessageNetworkEvent :: MonadIO m => MessageNetworkEventCallback -> m (GClosure C_MessageNetworkEventCallback)
- mk_MessageNetworkEventCallback :: C_MessageNetworkEventCallback -> IO (FunPtr C_MessageNetworkEventCallback)
- noMessageNetworkEventCallback :: Maybe MessageNetworkEventCallback
- onMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> MessageNetworkEventCallback -> m SignalHandlerId
- wrap_MessageNetworkEventCallback :: MessageNetworkEventCallback -> C_MessageNetworkEventCallback
- type C_MessageRestartedCallback = Ptr () -> Ptr () -> IO ()
- type MessageRestartedCallback = IO ()
- afterMessageRestarted :: (IsMessage a, MonadIO m) => a -> MessageRestartedCallback -> m SignalHandlerId
- genClosure_MessageRestarted :: MonadIO m => MessageRestartedCallback -> m (GClosure C_MessageRestartedCallback)
- mk_MessageRestartedCallback :: C_MessageRestartedCallback -> IO (FunPtr C_MessageRestartedCallback)
- noMessageRestartedCallback :: Maybe MessageRestartedCallback
- onMessageRestarted :: (IsMessage a, MonadIO m) => a -> MessageRestartedCallback -> m SignalHandlerId
- wrap_MessageRestartedCallback :: MessageRestartedCallback -> C_MessageRestartedCallback
- type C_MessageStartingCallback = Ptr () -> Ptr () -> IO ()
- type MessageStartingCallback = IO ()
- afterMessageStarting :: (IsMessage a, MonadIO m) => a -> MessageStartingCallback -> m SignalHandlerId
- genClosure_MessageStarting :: MonadIO m => MessageStartingCallback -> m (GClosure C_MessageStartingCallback)
- mk_MessageStartingCallback :: C_MessageStartingCallback -> IO (FunPtr C_MessageStartingCallback)
- noMessageStartingCallback :: Maybe MessageStartingCallback
- onMessageStarting :: (IsMessage a, MonadIO m) => a -> MessageStartingCallback -> m SignalHandlerId
- wrap_MessageStartingCallback :: MessageStartingCallback -> C_MessageStartingCallback
- type C_MessageWroteBodyCallback = Ptr () -> Ptr () -> IO ()
- type MessageWroteBodyCallback = IO ()
- afterMessageWroteBody :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyCallback -> m SignalHandlerId
- genClosure_MessageWroteBody :: MonadIO m => MessageWroteBodyCallback -> m (GClosure C_MessageWroteBodyCallback)
- mk_MessageWroteBodyCallback :: C_MessageWroteBodyCallback -> IO (FunPtr C_MessageWroteBodyCallback)
- noMessageWroteBodyCallback :: Maybe MessageWroteBodyCallback
- onMessageWroteBody :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyCallback -> m SignalHandlerId
- wrap_MessageWroteBodyCallback :: MessageWroteBodyCallback -> C_MessageWroteBodyCallback
- type C_MessageWroteBodyDataCallback = Ptr () -> Ptr Buffer -> Ptr () -> IO ()
- type MessageWroteBodyDataCallback = Buffer -> IO ()
- afterMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyDataCallback -> m SignalHandlerId
- genClosure_MessageWroteBodyData :: MonadIO m => MessageWroteBodyDataCallback -> m (GClosure C_MessageWroteBodyDataCallback)
- mk_MessageWroteBodyDataCallback :: C_MessageWroteBodyDataCallback -> IO (FunPtr C_MessageWroteBodyDataCallback)
- noMessageWroteBodyDataCallback :: Maybe MessageWroteBodyDataCallback
- onMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyDataCallback -> m SignalHandlerId
- wrap_MessageWroteBodyDataCallback :: MessageWroteBodyDataCallback -> C_MessageWroteBodyDataCallback
- type C_MessageWroteChunkCallback = Ptr () -> Ptr () -> IO ()
- type MessageWroteChunkCallback = IO ()
- afterMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> MessageWroteChunkCallback -> m SignalHandlerId
- genClosure_MessageWroteChunk :: MonadIO m => MessageWroteChunkCallback -> m (GClosure C_MessageWroteChunkCallback)
- mk_MessageWroteChunkCallback :: C_MessageWroteChunkCallback -> IO (FunPtr C_MessageWroteChunkCallback)
- noMessageWroteChunkCallback :: Maybe MessageWroteChunkCallback
- onMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> MessageWroteChunkCallback -> m SignalHandlerId
- wrap_MessageWroteChunkCallback :: MessageWroteChunkCallback -> C_MessageWroteChunkCallback
- type C_MessageWroteHeadersCallback = Ptr () -> Ptr () -> IO ()
- type MessageWroteHeadersCallback = IO ()
- afterMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> MessageWroteHeadersCallback -> m SignalHandlerId
- genClosure_MessageWroteHeaders :: MonadIO m => MessageWroteHeadersCallback -> m (GClosure C_MessageWroteHeadersCallback)
- mk_MessageWroteHeadersCallback :: C_MessageWroteHeadersCallback -> IO (FunPtr C_MessageWroteHeadersCallback)
- noMessageWroteHeadersCallback :: Maybe MessageWroteHeadersCallback
- onMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> MessageWroteHeadersCallback -> m SignalHandlerId
- wrap_MessageWroteHeadersCallback :: MessageWroteHeadersCallback -> C_MessageWroteHeadersCallback
- type C_MessageWroteInformationalCallback = Ptr () -> Ptr () -> IO ()
- type MessageWroteInformationalCallback = IO ()
- afterMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> MessageWroteInformationalCallback -> m SignalHandlerId
- genClosure_MessageWroteInformational :: MonadIO m => MessageWroteInformationalCallback -> m (GClosure C_MessageWroteInformationalCallback)
- mk_MessageWroteInformationalCallback :: C_MessageWroteInformationalCallback -> IO (FunPtr C_MessageWroteInformationalCallback)
- noMessageWroteInformationalCallback :: Maybe MessageWroteInformationalCallback
- onMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> MessageWroteInformationalCallback -> m SignalHandlerId
- wrap_MessageWroteInformationalCallback :: MessageWroteInformationalCallback -> C_MessageWroteInformationalCallback
Exported types
Memory-managed wrapper type.
Instances
GObject Message Source # | |
Defined in GI.Soup.Objects.Message gobjectType :: IO GType # | |
HasParentTypes Message Source # | |
Defined in GI.Soup.Objects.Message | |
type ParentTypes Message Source # | |
Defined in GI.Soup.Objects.Message |
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
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
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
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.
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-Request
<!-- -->-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.
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 () |
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 => URI -> IO (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 => [MessageFlags] -> IO (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 => HTTPVersion -> IO (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 ]
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 => Text -> IO (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 => MessagePriority -> IO (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 => Text -> IO (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 => Bool -> IO (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
statusCode
No description available in the introspection data.
constructMessageStatusCode :: IsMessage o => Word32 -> IO (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, IsTlsCertificate a) => a -> IO (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
:tls-certificate
Since: 2.34
constructMessageTlsErrors :: IsMessage o => [TlsCertificateFlags] -> IO (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 => URI -> IO (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 C_MessageContentSniffedCallback = Ptr () -> CString -> Ptr (GHashTable CString CString) -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MessageContentSniffedCallback Source #
= Text |
|
-> Map Text Text |
|
-> IO () |
This signal is emitted after Message
::got-headers
, and
before the first Message
::got-chunk
. 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
::got-headers
, and type
is
Nothing
.
If the ContentSniffer
feature is enabled, and the
sniffer decided to perform sniffing, the first
Message
::got-chunk
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
::got-chunk
.
Since: 2.28
afterMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> MessageContentSniffedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “content-sniffed
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #contentSniffed callback
genClosure_MessageContentSniffed :: MonadIO m => MessageContentSniffedCallback -> m (GClosure C_MessageContentSniffedCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageContentSniffedCallback :: C_MessageContentSniffedCallback -> IO (FunPtr C_MessageContentSniffedCallback) Source #
Generate a function pointer callable from C code, from a C_MessageContentSniffedCallback
.
noMessageContentSniffedCallback :: Maybe MessageContentSniffedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageContentSniffedCallback
onMessageContentSniffed :: (IsMessage a, MonadIO m) => a -> MessageContentSniffedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “content-sniffed
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #contentSniffed callback
wrap_MessageContentSniffedCallback :: MessageContentSniffedCallback -> C_MessageContentSniffedCallback Source #
Wrap a MessageContentSniffedCallback
into a C_MessageContentSniffedCallback
.
finished
type C_MessageFinishedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MessageFinishedCallback = IO () Source #
afterMessageFinished :: (IsMessage a, MonadIO m) => 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
genClosure_MessageFinished :: MonadIO m => MessageFinishedCallback -> m (GClosure C_MessageFinishedCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageFinishedCallback :: C_MessageFinishedCallback -> IO (FunPtr C_MessageFinishedCallback) Source #
Generate a function pointer callable from C code, from a C_MessageFinishedCallback
.
noMessageFinishedCallback :: Maybe MessageFinishedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageFinishedCallback
onMessageFinished :: (IsMessage a, MonadIO m) => 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
wrap_MessageFinishedCallback :: MessageFinishedCallback -> C_MessageFinishedCallback Source #
Wrap a MessageFinishedCallback
into a C_MessageFinishedCallback
.
gotBody
type C_MessageGotBodyCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageGotBodyCallback -> m SignalHandlerId Source #
Connect a signal handler for the “got-body
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #gotBody callback
genClosure_MessageGotBody :: MonadIO m => MessageGotBodyCallback -> m (GClosure C_MessageGotBodyCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageGotBodyCallback :: C_MessageGotBodyCallback -> IO (FunPtr C_MessageGotBodyCallback) Source #
Generate a function pointer callable from C code, from a C_MessageGotBodyCallback
.
noMessageGotBodyCallback :: Maybe MessageGotBodyCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageGotBodyCallback
onMessageGotBody :: (IsMessage a, MonadIO m) => a -> MessageGotBodyCallback -> m SignalHandlerId Source #
Connect a signal handler for the “got-body
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #gotBody callback
wrap_MessageGotBodyCallback :: MessageGotBodyCallback -> C_MessageGotBodyCallback Source #
Wrap a MessageGotBodyCallback
into a C_MessageGotBodyCallback
.
gotChunk
type C_MessageGotChunkCallback = Ptr () -> Ptr Buffer -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageGotChunkCallback -> m SignalHandlerId Source #
Connect a signal handler for the “got-chunk
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #gotChunk callback
genClosure_MessageGotChunk :: MonadIO m => MessageGotChunkCallback -> m (GClosure C_MessageGotChunkCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageGotChunkCallback :: C_MessageGotChunkCallback -> IO (FunPtr C_MessageGotChunkCallback) Source #
Generate a function pointer callable from C code, from a C_MessageGotChunkCallback
.
noMessageGotChunkCallback :: Maybe MessageGotChunkCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageGotChunkCallback
onMessageGotChunk :: (IsMessage a, MonadIO m) => a -> MessageGotChunkCallback -> m SignalHandlerId Source #
Connect a signal handler for the “got-chunk
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #gotChunk callback
wrap_MessageGotChunkCallback :: MessageGotChunkCallback -> C_MessageGotChunkCallback Source #
Wrap a MessageGotChunkCallback
into a C_MessageGotChunkCallback
.
gotHeaders
type C_MessageGotHeadersCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageGotHeadersCallback -> m SignalHandlerId Source #
Connect a signal handler for the “got-headers
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #gotHeaders callback
genClosure_MessageGotHeaders :: MonadIO m => MessageGotHeadersCallback -> m (GClosure C_MessageGotHeadersCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageGotHeadersCallback :: C_MessageGotHeadersCallback -> IO (FunPtr C_MessageGotHeadersCallback) Source #
Generate a function pointer callable from C code, from a C_MessageGotHeadersCallback
.
noMessageGotHeadersCallback :: Maybe MessageGotHeadersCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageGotHeadersCallback
onMessageGotHeaders :: (IsMessage a, MonadIO m) => a -> MessageGotHeadersCallback -> m SignalHandlerId Source #
Connect a signal handler for the “got-headers
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #gotHeaders callback
wrap_MessageGotHeadersCallback :: MessageGotHeadersCallback -> C_MessageGotHeadersCallback Source #
Wrap a MessageGotHeadersCallback
into a C_MessageGotHeadersCallback
.
gotInformational
type C_MessageGotInformationalCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageGotInformationalCallback -> m SignalHandlerId Source #
Connect a signal handler for the “got-informational
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #gotInformational callback
genClosure_MessageGotInformational :: MonadIO m => MessageGotInformationalCallback -> m (GClosure C_MessageGotInformationalCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageGotInformationalCallback :: C_MessageGotInformationalCallback -> IO (FunPtr C_MessageGotInformationalCallback) Source #
Generate a function pointer callable from C code, from a C_MessageGotInformationalCallback
.
noMessageGotInformationalCallback :: Maybe MessageGotInformationalCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageGotInformationalCallback
onMessageGotInformational :: (IsMessage a, MonadIO m) => a -> MessageGotInformationalCallback -> m SignalHandlerId Source #
Connect a signal handler for the “got-informational
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #gotInformational callback
wrap_MessageGotInformationalCallback :: MessageGotInformationalCallback -> C_MessageGotInformationalCallback Source #
Wrap a MessageGotInformationalCallback
into a C_MessageGotInformationalCallback
.
networkEvent
type C_MessageNetworkEventCallback = Ptr () -> CUInt -> Ptr IOStream -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageNetworkEventCallback -> m SignalHandlerId Source #
Connect a signal handler for the “network-event
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #networkEvent callback
genClosure_MessageNetworkEvent :: MonadIO m => MessageNetworkEventCallback -> m (GClosure C_MessageNetworkEventCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageNetworkEventCallback :: C_MessageNetworkEventCallback -> IO (FunPtr C_MessageNetworkEventCallback) Source #
Generate a function pointer callable from C code, from a C_MessageNetworkEventCallback
.
noMessageNetworkEventCallback :: Maybe MessageNetworkEventCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageNetworkEventCallback
onMessageNetworkEvent :: (IsMessage a, MonadIO m) => a -> MessageNetworkEventCallback -> m SignalHandlerId Source #
Connect a signal handler for the “network-event
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #networkEvent callback
wrap_MessageNetworkEventCallback :: MessageNetworkEventCallback -> C_MessageNetworkEventCallback Source #
Wrap a MessageNetworkEventCallback
into a C_MessageNetworkEventCallback
.
restarted
type C_MessageRestartedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> 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
genClosure_MessageRestarted :: MonadIO m => MessageRestartedCallback -> m (GClosure C_MessageRestartedCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageRestartedCallback :: C_MessageRestartedCallback -> IO (FunPtr C_MessageRestartedCallback) Source #
Generate a function pointer callable from C code, from a C_MessageRestartedCallback
.
noMessageRestartedCallback :: Maybe MessageRestartedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageRestartedCallback
onMessageRestarted :: (IsMessage a, MonadIO m) => 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
wrap_MessageRestartedCallback :: MessageRestartedCallback -> C_MessageRestartedCallback Source #
Wrap a MessageRestartedCallback
into a C_MessageRestartedCallback
.
starting
type C_MessageStartingCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MessageStartingCallback = IO () Source #
Emitted just before a message is sent.
Since: 2.50
afterMessageStarting :: (IsMessage a, MonadIO m) => 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
genClosure_MessageStarting :: MonadIO m => MessageStartingCallback -> m (GClosure C_MessageStartingCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageStartingCallback :: C_MessageStartingCallback -> IO (FunPtr C_MessageStartingCallback) Source #
Generate a function pointer callable from C code, from a C_MessageStartingCallback
.
noMessageStartingCallback :: Maybe MessageStartingCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageStartingCallback
onMessageStarting :: (IsMessage a, MonadIO m) => 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
wrap_MessageStartingCallback :: MessageStartingCallback -> C_MessageStartingCallback Source #
Wrap a MessageStartingCallback
into a C_MessageStartingCallback
.
wroteBody
type C_MessageWroteBodyCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageWroteBodyCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-body
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #wroteBody callback
genClosure_MessageWroteBody :: MonadIO m => MessageWroteBodyCallback -> m (GClosure C_MessageWroteBodyCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageWroteBodyCallback :: C_MessageWroteBodyCallback -> IO (FunPtr C_MessageWroteBodyCallback) Source #
Generate a function pointer callable from C code, from a C_MessageWroteBodyCallback
.
noMessageWroteBodyCallback :: Maybe MessageWroteBodyCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageWroteBodyCallback
onMessageWroteBody :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-body
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #wroteBody callback
wrap_MessageWroteBodyCallback :: MessageWroteBodyCallback -> C_MessageWroteBodyCallback Source #
Wrap a MessageWroteBodyCallback
into a C_MessageWroteBodyCallback
.
wroteBodyData
type C_MessageWroteBodyDataCallback = Ptr () -> Ptr Buffer -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageWroteBodyDataCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-body-data
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #wroteBodyData callback
genClosure_MessageWroteBodyData :: MonadIO m => MessageWroteBodyDataCallback -> m (GClosure C_MessageWroteBodyDataCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageWroteBodyDataCallback :: C_MessageWroteBodyDataCallback -> IO (FunPtr C_MessageWroteBodyDataCallback) Source #
Generate a function pointer callable from C code, from a C_MessageWroteBodyDataCallback
.
noMessageWroteBodyDataCallback :: Maybe MessageWroteBodyDataCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageWroteBodyDataCallback
onMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> MessageWroteBodyDataCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-body-data
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #wroteBodyData callback
wrap_MessageWroteBodyDataCallback :: MessageWroteBodyDataCallback -> C_MessageWroteBodyDataCallback Source #
Wrap a MessageWroteBodyDataCallback
into a C_MessageWroteBodyDataCallback
.
wroteChunk
type C_MessageWroteChunkCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageWroteChunkCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-chunk
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #wroteChunk callback
genClosure_MessageWroteChunk :: MonadIO m => MessageWroteChunkCallback -> m (GClosure C_MessageWroteChunkCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageWroteChunkCallback :: C_MessageWroteChunkCallback -> IO (FunPtr C_MessageWroteChunkCallback) Source #
Generate a function pointer callable from C code, from a C_MessageWroteChunkCallback
.
noMessageWroteChunkCallback :: Maybe MessageWroteChunkCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageWroteChunkCallback
onMessageWroteChunk :: (IsMessage a, MonadIO m) => a -> MessageWroteChunkCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-chunk
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #wroteChunk callback
wrap_MessageWroteChunkCallback :: MessageWroteChunkCallback -> C_MessageWroteChunkCallback Source #
Wrap a MessageWroteChunkCallback
into a C_MessageWroteChunkCallback
.
wroteHeaders
type C_MessageWroteHeadersCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
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 -> MessageWroteHeadersCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-headers
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #wroteHeaders callback
genClosure_MessageWroteHeaders :: MonadIO m => MessageWroteHeadersCallback -> m (GClosure C_MessageWroteHeadersCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageWroteHeadersCallback :: C_MessageWroteHeadersCallback -> IO (FunPtr C_MessageWroteHeadersCallback) Source #
Generate a function pointer callable from C code, from a C_MessageWroteHeadersCallback
.
noMessageWroteHeadersCallback :: Maybe MessageWroteHeadersCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageWroteHeadersCallback
onMessageWroteHeaders :: (IsMessage a, MonadIO m) => a -> MessageWroteHeadersCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-headers
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #wroteHeaders callback
wrap_MessageWroteHeadersCallback :: MessageWroteHeadersCallback -> C_MessageWroteHeadersCallback Source #
Wrap a MessageWroteHeadersCallback
into a C_MessageWroteHeadersCallback
.
wroteInformational
type C_MessageWroteInformationalCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MessageWroteInformationalCallback = IO () Source #
Emitted immediately after writing a 1xx (Informational) response for a (server-side) message.
afterMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> MessageWroteInformationalCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-informational
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
message #wroteInformational callback
genClosure_MessageWroteInformational :: MonadIO m => MessageWroteInformationalCallback -> m (GClosure C_MessageWroteInformationalCallback) Source #
Wrap the callback into a GClosure
.
mk_MessageWroteInformationalCallback :: C_MessageWroteInformationalCallback -> IO (FunPtr C_MessageWroteInformationalCallback) Source #
Generate a function pointer callable from C code, from a C_MessageWroteInformationalCallback
.
noMessageWroteInformationalCallback :: Maybe MessageWroteInformationalCallback Source #
A convenience synonym for
.Nothing
:: Maybe
MessageWroteInformationalCallback
onMessageWroteInformational :: (IsMessage a, MonadIO m) => a -> MessageWroteInformationalCallback -> m SignalHandlerId Source #
Connect a signal handler for the “wrote-informational
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
message #wroteInformational callback