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
- addFlags
- disableFeature
- getConnectionId
- getFirstParty
- getFlags
- getForceHttp1
- getHttpVersion
- getIsOptionsPing
- getIsTopLevelNavigation
- getMethod
- getMetrics
- getPriority
- getReasonPhrase
- getRemoteAddress
- getRequestHeaders
- getResponseHeaders
- getSiteForCookies
- getStatus
- getTlsCiphersuiteName
- getTlsPeerCertificate
- getTlsPeerCertificateErrors
- getTlsProtocolVersion
- getUri
- isFeatureDisabled
- isKeepalive
- new
- newFromEncodedForm
- newFromMultipart
- newFromUri
- newOptionsPing
- queryFlags
- removeFlags
- setFirstParty
- setFlags
- setForceHttp1
- setIsOptionsPing
- setIsTopLevelNavigation
- setMethod
- setPriority
- setRequestBody
- setRequestBodyFromBytes
- setSiteForCookies
- setTlsClientCertificate
- setUri
- tlsClientCertificatePasswordRequestComplete
- Properties
- Signals
Represents an HTTP message being sent or received.
A Message
represents an HTTP message that is being sent or
received.
You would create a Message
with [ctormessage
.new] or
[ctormessage
.new_from_uri], set up its fields appropriately, and send it.
- property
message
:status-code - will normally be a [enum
status
] value, eg,StatusOk
, though of course it might actually be an unknown status code. [propertymessage
:reason-phrase] is the actual text returned from the server, which may or may not correspond to the "standard" description ofstatusCode
. 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 - property
message
:reason-phrase - in user-visible messages. Rather, you should
look at [property
message
:status-code], and determine an end-user-appropriate message based on that and on what you were trying to do.
Note that libsoup's terminology here does not quite match the HTTP
specification: in RFC 2616, an "HTTP-message" is *either* a Request, *or* a
Response. In libsoup, a Message
combines both the request and the
response.
Synopsis
- newtype Message = Message (ManagedPtr Message)
- class (GObject o, IsDescendantOf Message o) => IsMessage o
- toMessage :: (MonadIO m, IsMessage o) => o -> m Message
- messageAddFlags :: (HasCallStack, MonadIO m, IsMessage a) => a -> [MessageFlags] -> m ()
- messageDisableFeature :: (HasCallStack, MonadIO m, IsMessage a) => a -> GType -> m ()
- messageGetConnectionId :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Word64
- messageGetFirstParty :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Uri
- messageGetFlags :: (HasCallStack, MonadIO m, IsMessage a) => a -> m [MessageFlags]
- messageGetForceHttp1 :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Bool
- messageGetHttpVersion :: (HasCallStack, MonadIO m, IsMessage a) => a -> m HTTPVersion
- messageGetIsOptionsPing :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Bool
- messageGetIsTopLevelNavigation :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Bool
- messageGetMethod :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Text
- messageGetMetrics :: (HasCallStack, MonadIO m, IsMessage a) => a -> m (Maybe MessageMetrics)
- messageGetPriority :: (HasCallStack, MonadIO m, IsMessage a) => a -> m MessagePriority
- messageGetReasonPhrase :: (HasCallStack, MonadIO m, IsMessage a) => a -> m (Maybe Text)
- messageGetRemoteAddress :: (HasCallStack, MonadIO m, IsMessage a) => a -> m (Maybe SocketAddress)
- messageGetRequestHeaders :: (HasCallStack, MonadIO m, IsMessage a) => a -> m MessageHeaders
- messageGetResponseHeaders :: (HasCallStack, MonadIO m, IsMessage a) => a -> m MessageHeaders
- messageGetSiteForCookies :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Uri
- messageGetStatus :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Status
- messageGetTlsCiphersuiteName :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Text
- messageGetTlsPeerCertificate :: (HasCallStack, MonadIO m, IsMessage a) => a -> m (Maybe TlsCertificate)
- messageGetTlsPeerCertificateErrors :: (HasCallStack, MonadIO m, IsMessage a) => a -> m [TlsCertificateFlags]
- messageGetTlsProtocolVersion :: (HasCallStack, MonadIO m, IsMessage a) => a -> m TlsProtocolVersion
- messageGetUri :: (HasCallStack, MonadIO m, IsMessage a) => a -> m Uri
- 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)
- messageNewFromEncodedForm :: (HasCallStack, MonadIO m) => Text -> Text -> Text -> m (Maybe Message)
- messageNewFromMultipart :: (HasCallStack, MonadIO m) => Text -> Multipart -> m (Maybe Message)
- messageNewFromUri :: (HasCallStack, MonadIO m) => Text -> Uri -> m Message
- messageNewOptionsPing :: (HasCallStack, MonadIO m) => Uri -> m Message
- messageQueryFlags :: (HasCallStack, MonadIO m, IsMessage a) => a -> [MessageFlags] -> m Bool
- messageRemoveFlags :: (HasCallStack, MonadIO m, IsMessage a) => a -> [MessageFlags] -> m ()
- messageSetFirstParty :: (HasCallStack, MonadIO m, IsMessage a) => a -> Uri -> m ()
- messageSetFlags :: (HasCallStack, MonadIO m, IsMessage a) => a -> [MessageFlags] -> m ()
- messageSetForceHttp1 :: (HasCallStack, MonadIO m, IsMessage a) => a -> Bool -> m ()
- messageSetIsOptionsPing :: (HasCallStack, MonadIO m, IsMessage a) => a -> Bool -> m ()
- messageSetIsTopLevelNavigation :: (HasCallStack, MonadIO m, IsMessage a) => a -> Bool -> m ()
- messageSetMethod :: (HasCallStack, MonadIO m, IsMessage a) => a -> Text -> m ()
- messageSetPriority :: (HasCallStack, MonadIO m, IsMessage a) => a -> MessagePriority -> m ()
- messageSetRequestBody :: (HasCallStack, MonadIO m, IsMessage a, IsInputStream b) => a -> Maybe Text -> Maybe b -> Int64 -> m ()
- messageSetRequestBodyFromBytes :: (HasCallStack, MonadIO m, IsMessage a) => a -> Maybe Text -> Maybe Bytes -> m ()
- messageSetSiteForCookies :: (HasCallStack, MonadIO m, IsMessage a) => a -> Maybe Uri -> m ()
- messageSetTlsClientCertificate :: (HasCallStack, MonadIO m, IsMessage a, IsTlsCertificate b) => a -> Maybe b -> m ()
- messageSetUri :: (HasCallStack, MonadIO m, IsMessage a) => a -> Uri -> m ()
- messageTlsClientCertificatePasswordRequestComplete :: (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 ()
- getMessageHttpVersion :: (MonadIO m, IsMessage o) => o -> m HTTPVersion
- constructMessageIsOptionsPing :: (IsMessage o, MonadIO m) => Bool -> m (GValueConstruct o)
- getMessageIsOptionsPing :: (MonadIO m, IsMessage o) => o -> m Bool
- setMessageIsOptionsPing :: (MonadIO m, IsMessage o) => o -> Bool -> 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 ()
- constructMessageMethod :: (IsMessage o, MonadIO m) => Text -> m (GValueConstruct o)
- getMessageMethod :: (MonadIO m, IsMessage o) => o -> m 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 ()
- getMessageReasonPhrase :: (MonadIO m, IsMessage o) => o -> m (Maybe Text)
- getMessageRemoteAddress :: (MonadIO m, IsMessage o) => o -> m (Maybe SocketAddress)
- getMessageRequestHeaders :: (MonadIO m, IsMessage o) => o -> m MessageHeaders
- getMessageResponseHeaders :: (MonadIO m, IsMessage o) => o -> m MessageHeaders
- 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 ()
- getMessageStatusCode :: (MonadIO m, IsMessage o) => o -> m Word32
- getMessageTlsCiphersuiteName :: (MonadIO m, IsMessage o) => o -> m Text
- getMessageTlsPeerCertificate :: (MonadIO m, IsMessage o) => o -> m (Maybe TlsCertificate)
- getMessageTlsPeerCertificateErrors :: (MonadIO m, IsMessage o) => o -> m [TlsCertificateFlags]
- getMessageTlsProtocolVersion :: (MonadIO m, IsMessage o) => o -> m TlsProtocolVersion
- 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 MessageAcceptCertificateCallback = TlsCertificate -> [TlsCertificateFlags] -> IO Bool
- afterMessageAcceptCertificate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageAcceptCertificateCallback) -> m SignalHandlerId
- onMessageAcceptCertificate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageAcceptCertificateCallback) -> m SignalHandlerId
- type MessageAuthenticateCallback = Auth -> Bool -> IO Bool
- afterMessageAuthenticate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageAuthenticateCallback) -> m SignalHandlerId
- onMessageAuthenticate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageAuthenticateCallback) -> m SignalHandlerId
- 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 MessageGotBodyDataCallback = Word32 -> IO ()
- afterMessageGotBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotBodyDataCallback) -> m SignalHandlerId
- onMessageGotBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotBodyDataCallback) -> 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 MessageHstsEnforcedCallback = IO ()
- afterMessageHstsEnforced :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageHstsEnforcedCallback) -> m SignalHandlerId
- onMessageHstsEnforced :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageHstsEnforcedCallback) -> 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 MessageRequestCertificateCallback = TlsClientConnection -> IO Bool
- afterMessageRequestCertificate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRequestCertificateCallback) -> m SignalHandlerId
- onMessageRequestCertificate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRequestCertificateCallback) -> m SignalHandlerId
- type MessageRequestCertificatePasswordCallback = TlsPassword -> IO Bool
- afterMessageRequestCertificatePassword :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRequestCertificatePasswordCallback) -> m SignalHandlerId
- onMessageRequestCertificatePassword :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRequestCertificatePasswordCallback) -> 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 = Word32 -> IO ()
- afterMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyDataCallback) -> m SignalHandlerId
- onMessageWroteBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageWroteBodyDataCallback) -> 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
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
addFlags, bindProperty, bindPropertyFull, disableFeature, forceFloating, freezeNotify, getv, isFeatureDisabled, isFloating, isKeepalive, notify, notifyByPspec, queryFlags, ref, refSink, removeFlags, runDispose, stealData, stealQdata, thawNotify, tlsClientCertificatePasswordRequestComplete, unref, watchClosure.
Getters
getConnectionId, getData, getFirstParty, getFlags, getForceHttp1, getHttpVersion, getIsOptionsPing, getIsTopLevelNavigation, getMethod, getMetrics, getPriority, getProperty, getQdata, getReasonPhrase, getRemoteAddress, getRequestHeaders, getResponseHeaders, getSiteForCookies, getStatus, getTlsCiphersuiteName, getTlsPeerCertificate, getTlsPeerCertificateErrors, getTlsProtocolVersion, getUri.
Setters
setData, setDataFull, setFirstParty, setFlags, setForceHttp1, setIsOptionsPing, setIsTopLevelNavigation, setMethod, setPriority, setProperty, setRequestBody, setRequestBodyFromBytes, setSiteForCookies, setTlsClientCertificate, setUri.
addFlags
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> [MessageFlags] |
|
-> m () |
Adds flags
to the set of msg
's flags.
disableFeature
messageDisableFeature Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> GType |
|
-> m () |
Disables the actions of [ifacesessionFeature
]s with the
given featureType
(or a subclass of that type) on msg
.
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.
getConnectionId
messageGetConnectionId Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Word64 | Returns: An id or 0 if no connection. |
Returns the unique idenfier for the last connection used.
This may be 0 if it was a cached resource or it has not gotten a connection yet.
getFirstParty
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Uri | Returns: the |
Gets msg
's first-party [structgLib
.Uri].
getFlags
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m [MessageFlags] | Returns: the flags |
Gets the flags on msg
.
getForceHttp1
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Bool |
Returns whether HTTP/1 version is currently demanded for the msg
send.
Since: 3.4
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.
getIsOptionsPing
messageGetIsOptionsPing Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether msg
is intended to be used to send OPTIONS *
to a server.
getIsTopLevelNavigation
messageGetIsTopLevelNavigation Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Bool | Returns: Whether the current request is a top-level navitation |
Returns if this message is set as a top level navigation.
Used for same-site policy checks.
getMethod
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Text | Returns: A method such as |
Returns the method of this message.
getMetrics
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m (Maybe MessageMetrics) | Returns: a |
Get the [structmessageMetrics
] of msg
.
If the flag MessageFlagsCollectMetrics
is not enabled for msg
this will
return Nothing
.
getPriority
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m MessagePriority | Returns: the priority of the message. |
Retrieves the [enummessagePriority
].
If not set this value defaults to SOUP_MESSAGE_PRIORITY_NORMAL
.
getReasonPhrase
messageGetReasonPhrase Source #
Returns the reason phrase for the status of this message.
getRemoteAddress
messageGetRemoteAddress Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m (Maybe SocketAddress) | Returns: a |
Get the remote SocketAddress
of the connection associated with
the message.
The returned address can be Nothing
if the connection hasn't been established
yet, or the resource was loaded from the disk cache. In case of proxy
connections, the remote address returned is a ProxyAddress
. If
[propertysession
:remote-connectable] is set the returned address id for the
connection to the session's remote connectable.
getRequestHeaders
messageGetRequestHeaders Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m MessageHeaders | Returns: The |
Returns the headers sent with the request.
getResponseHeaders
messageGetResponseHeaders Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m MessageHeaders | Returns: The |
Returns the headers recieved with the response.
getSiteForCookies
messageGetSiteForCookies Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Uri | Returns: the |
Gets msg
's site for cookies Uri
.
getStatus
Returns the set status of this message.
getTlsCiphersuiteName
messageGetTlsCiphersuiteName Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Text | Returns: the name of the TLS ciphersuite,
or |
Gets the name of the TLS ciphersuite negotiated for msg
's connection.
getTlsPeerCertificate
messageGetTlsPeerCertificate Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m (Maybe TlsCertificate) | Returns: |
Gets the peer's TlsCertificate
associated with msg
's connection.
Note that this is not set yet during the emission of
signalmessage
[acceptCertificate] signal.
getTlsPeerCertificateErrors
messageGetTlsPeerCertificateErrors Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m [TlsCertificateFlags] | Returns: a |
Gets the errors associated with validating msg
's TLS peer certificate.
Note that this is not set yet during the emission of
signalmessage
[acceptCertificate] signal.
getTlsProtocolVersion
messageGetTlsProtocolVersion Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m TlsProtocolVersion | Returns: a |
Gets the TLS protocol version negotiated for msg
's connection.
If the message connection is not SSL, TlsProtocolVersionUnknown
is returned.
getUri
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m Uri | Returns: the URI |
Gets msg
's URI.
isFeatureDisabled
messageIsFeatureDisabled Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> GType |
|
-> m Bool |
Get whether [ifacesessionFeature
]s of the given featureType
(or a subclass of that type) are disabled on msg
.
See [methodmessage
.disable_feature].
isKeepalive
Determines whether or not msg
's connection can be kept alive for
further requests after processing msg
.
The result is 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
.
newFromEncodedForm
messageNewFromEncodedForm Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Text |
|
-> m (Maybe Message) | Returns: the new |
Creates a new Message
and sets it up to send the given encodedForm
to uri
via method
. If method
is "GET", it will include the form data
into uri
's query field, and if method
is "POST" or "PUT", it will be set as
request body.
This function takes the ownership of encodedForm
, that will be released
with free
when no longer in use. See also [funcformEncode
],
[funcformEncodeHash
] and [funcformEncodeDatalist
].
newFromMultipart
messageNewFromMultipart Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Multipart |
|
-> m (Maybe Message) | Returns: the new |
Creates a new Message
and sets it up to send multipart
to
uriString
via POST.
newFromUri
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Uri |
|
-> m Message | Returns: the new |
Creates a new empty Message
, which will connect to uri
.
newOptionsPing
messageNewOptionsPing Source #
:: (HasCallStack, MonadIO m) | |
=> Uri |
|
-> m Message | Returns: the new |
Creates a new Message
to send OPTIONS *
to a server. The path of
baseUri
will be ignored.
queryFlags
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> [MessageFlags] |
|
-> m Bool | Returns: |
Queries if flags
are present in the set of msg
's flags.
removeFlags
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> [MessageFlags] |
|
-> m () |
Removes flags
from the set of msg
's flags.
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
[enumcookieJarAcceptPolicy
].
setFlags
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> [MessageFlags] |
|
-> m () |
Sets the specified flags on msg
.
setForceHttp1
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether HTTP/1 version should be used when sending this message. Some connections can still override it, if needed.
Note the value is unset after the message send is finished.
Since: 3.4
setIsOptionsPing
messageSetIsOptionsPing Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Bool |
|
-> m () |
Set whether msg
is intended to be used to send OPTIONS *
to a server.
When set to True
, the path of [propertymessage
:uri] will be ignored and
[propertymessage
:method] set to SOUP_METHOD_OPTIONS
.
setIsTopLevelNavigation
messageSetIsTopLevelNavigation Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the current request is a top-level navitation.
See the same-site spec for more information.
setMethod
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Text |
|
-> m () |
Set msg
's HTTP method to method
.
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 synchronous messages because in the synchronous/blocking case, priority ends up being determined semi-randomly by thread scheduling.
setRequestBody
messageSetRequestBody Source #
:: (HasCallStack, MonadIO m, IsMessage a, IsInputStream b) | |
=> a |
|
-> Maybe Text |
|
-> Maybe b |
|
-> Int64 |
|
-> m () |
setRequestBodyFromBytes
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.
setTlsClientCertificate
messageSetTlsClientCertificate Source #
:: (HasCallStack, MonadIO m, IsMessage a, IsTlsCertificate b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the certificate
to be used by msg
's connection when a
client certificate is requested during the TLS handshake.
You can call this as a response to signalmessage
[requestCertificate]
signal, or before the connection is started. If certificate
is Nothing
the handshake will continue without providing a GTlsCertificate.
Note that the TlsCertificate
set by this function will be ignored if
[propertysession
:tls-interaction] is not Nothing
.
setUri
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> Uri |
|
-> m () |
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 send it again.
tlsClientCertificatePasswordRequestComplete
messageTlsClientCertificatePasswordRequestComplete Source #
:: (HasCallStack, MonadIO m, IsMessage a) | |
=> a |
|
-> m () |
Completes a certificate password request.
You must call this as a response to
signalmessage
[requestCertificatePassword] signal, to notify msg
that
the TlsPassword
has already been updated.
Properties
firstParty
The [structgLib
.Uri] loaded in the application when the message was
queued.
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
Various message options.
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
The HTTP protocol version to use.
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
isOptionsPing
Whether the message is an OPTIONS ping.
The Message
is intended to be used to send
OPTIONS *
to a server. When set to True
, the
path of [propertymessage
:uri] will be ignored and
[propertymessage
:method] set to SOUP_METHOD_OPTIONS
.
constructMessageIsOptionsPing :: (IsMessage o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “is-options-ping
” property. This is rarely needed directly, but it is used by new
.
getMessageIsOptionsPing :: (MonadIO m, IsMessage o) => o -> m Bool Source #
Get the value of the “is-options-ping
” property.
When overloading is enabled, this is equivalent to
get
message #isOptionsPing
setMessageIsOptionsPing :: (MonadIO m, IsMessage o) => o -> Bool -> m () Source #
Set the value of the “is-options-ping
” property.
When overloading is enabled, this is equivalent to
set
message [ #isOptionsPing:=
value ]
isTopLevelNavigation
Set when the message is navigating between top level domains.
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
The message's HTTP 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 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
Sets the priority of the Message
. See
[methodmessage
.set_priority] for further details.
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
The HTTP response reason phrase.
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
remoteAddress
The remote SocketAddress
of the connection associated
with the message.
getMessageRemoteAddress :: (MonadIO m, IsMessage o) => o -> m (Maybe SocketAddress) Source #
Get the value of the “remote-address
” property.
When overloading is enabled, this is equivalent to
get
message #remoteAddress
requestHeaders
The HTTP request headers.
getMessageRequestHeaders :: (MonadIO m, IsMessage o) => o -> m MessageHeaders Source #
Get the value of the “request-headers
” property.
When overloading is enabled, this is equivalent to
get
message #requestHeaders
responseHeaders
The HTTP response headers.
getMessageResponseHeaders :: (MonadIO m, IsMessage o) => o -> m MessageHeaders Source #
Get the value of the “response-headers
” property.
When overloading is enabled, this is equivalent to
get
message #responseHeaders
siteForCookies
Site used to compare cookies against. Used for SameSite cookie support.
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
The HTTP response status code.
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
tlsCiphersuiteName
The Name of TLS ciphersuite negotiated for this message connection.
getMessageTlsCiphersuiteName :: (MonadIO m, IsMessage o) => o -> m Text Source #
Get the value of the “tls-ciphersuite-name
” property.
When overloading is enabled, this is equivalent to
get
message #tlsCiphersuiteName
tlsPeerCertificate
The peer's TlsCertificate
associated with the message.
getMessageTlsPeerCertificate :: (MonadIO m, IsMessage o) => o -> m (Maybe TlsCertificate) Source #
Get the value of the “tls-peer-certificate
” property.
When overloading is enabled, this is equivalent to
get
message #tlsPeerCertificate
tlsPeerCertificateErrors
The verification errors on [propertymessage
:tls-peer-certificate].
getMessageTlsPeerCertificateErrors :: (MonadIO m, IsMessage o) => o -> m [TlsCertificateFlags] Source #
Get the value of the “tls-peer-certificate-errors
” property.
When overloading is enabled, this is equivalent to
get
message #tlsPeerCertificateErrors
tlsProtocolVersion
The TLS protocol version negotiated for the message connection.
getMessageTlsProtocolVersion :: (MonadIO m, IsMessage o) => o -> m TlsProtocolVersion Source #
Get the value of the “tls-protocol-version
” property.
When overloading is enabled, this is equivalent to
get
message #tlsProtocolVersion
uri
The message's Request-URI.
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
acceptCertificate
type MessageAcceptCertificateCallback Source #
= TlsCertificate |
|
-> [TlsCertificateFlags] |
|
-> IO Bool | Returns: |
Emitted during the msg
's connection TLS handshake
after an unacceptable TLS certificate has been received.
You can return True
to accept tlsCertificate
despite
tlsErrors
.
afterMessageAcceptCertificate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageAcceptCertificateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the acceptCertificate signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #acceptCertificate 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.
onMessageAcceptCertificate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageAcceptCertificateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the acceptCertificate signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #acceptCertificate callback
authenticate
type MessageAuthenticateCallback Source #
= Auth |
|
-> Bool |
|
-> IO Bool | Returns: |
Emitted when the message requires authentication.
If credentials are available call [methodauth
.authenticate] on
auth
. If these credentials fail, the signal will be emitted again,
with retrying
set to True
, which will continue until you return
without calling [methodauth
.authenticate] on auth
.
Note that this may be emitted before msg
's body has been
fully read.
You can authenticate auth
asynchronously by calling
objectRef
on auth
and returning True
. The operation will
complete once either [methodauth
.authenticate] or
[methodauth
.cancel] are called.
afterMessageAuthenticate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageAuthenticateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the authenticate signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #authenticate 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.
onMessageAuthenticate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageAuthenticateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the authenticate signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #authenticate callback
contentSniffed
type MessageContentSniffedCallback Source #
= Text |
|
-> Map Text Text |
|
-> IO () |
This signal is emitted after signalmessage
[gotHeaders].
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 signalmessage
[gotHeaders], and type
is
Nothing
.
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 #
Emitted when all HTTP processing is finished for a message.
(After signalmessage
[got_body]).
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 response body.
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
gotBodyData
type MessageGotBodyDataCallback Source #
Emitted after reading a portion of the message body from the network.
Since: 3.4
afterMessageGotBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotBodyDataCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotBodyData signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #gotBodyData 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.
onMessageGotBodyData :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageGotBodyDataCallback) -> m SignalHandlerId Source #
Connect a signal handler for the gotBodyData signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #gotBodyData callback
gotHeaders
type MessageGotHeadersCallback = IO () Source #
Emitted after receiving the Status-Line and response headers.
See also [methodmessage
.add_header_handler] and
[methodmessage
.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 signalmessage
[gotBody] handler rather
than a signalmessage
[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
hstsEnforced
type MessageHstsEnforcedCallback = IO () Source #
Emitted when [classhSTSEnforcer
] has upgraded the protocol
for msg
to HTTPS as a result of matching its domain with
a HSTS policy.
afterMessageHstsEnforced :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageHstsEnforcedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the hstsEnforced signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #hstsEnforced 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.
onMessageHstsEnforced :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageHstsEnforcedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the hstsEnforced signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #hstsEnforced 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.
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
requestCertificate
type MessageRequestCertificateCallback Source #
= TlsClientConnection |
|
-> IO Bool | Returns: |
Emitted during the msg
's connection TLS handshake when
tlsConnection
requests a certificate from the client.
You can set the client certificate by calling
[methodmessage
.set_tls_client_certificate] and returning True
. It's
possible to handle the request asynchornously by returning True
and
call [methodmessage
.set_tls_client_certificate] later once the
certificate is available. Note that this signal is not emitted if
[propertysession
:tls-interaction] was set, or if
[methodmessage
.set_tls_client_certificate] was called before the
connection TLS handshake started.
afterMessageRequestCertificate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRequestCertificateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the requestCertificate signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #requestCertificate 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.
onMessageRequestCertificate :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRequestCertificateCallback) -> m SignalHandlerId Source #
Connect a signal handler for the requestCertificate signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #requestCertificate callback
requestCertificatePassword
type MessageRequestCertificatePasswordCallback Source #
= TlsPassword |
|
-> IO Bool | Returns: |
Emitted during the msg
's connection TLS handshake when
tlsConnection
requests a certificate password from the client.
You can set the certificate password on password
, then call
[methodmessage
.tls_client_certificate_password_request_complete] and
return True
to handle the signal synchronously. It's possible to
handle the request asynchornously by calling
objectRef
on password
, then returning True
and
call
[methodmessage
.tls_client_certificate_password_request_complete]
later after setting the password on password
. Note that this signal
is not emitted if [propertysession
:tls-interaction] was set.
afterMessageRequestCertificatePassword :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRequestCertificatePasswordCallback) -> m SignalHandlerId Source #
Connect a signal handler for the requestCertificatePassword signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
message #requestCertificatePassword 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.
onMessageRequestCertificatePassword :: (IsMessage a, MonadIO m) => a -> ((?self :: a) => MessageRequestCertificatePasswordCallback) -> m SignalHandlerId Source #
Connect a signal handler for the requestCertificatePassword signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
message #requestCertificatePassword callback
restarted
type MessageRestartedCallback = IO () Source #
Emitted when a request that was already sent once is now being sent again.
e.g. 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.
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.
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.
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
wroteHeaders
type MessageWroteHeadersCallback = IO () Source #
Emitted immediately after writing the request headers for a message.
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