1.19 <SoupMessage>

Class: <SoupMessage>

It derives from <GObject>.

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 Message.new or Message.new_from_uri, set up its fields appropriately, and send it.

Message:status-code will normally be a Status value, eg, ok, though of course it might actually be an unknown status code. Message:reason-phrase is the actual text returned from the server, which may or may not correspond to the "standard" description of status-code. 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 Message:reason-phrase in user-visible messages. Rather, you should look at 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.

Properties

Property: message:first-party self

The <GUri> loaded in the application when the message was queued.

Its value is a <GUri>, or #f.

Set it with (set! (message:first-party self) value).

Property: message:flags self

Various message options.

Its value is a <SoupMessageFlags> (or, to set it, a list of its symbols, or one of them).

Set it with (set! (message:flags self) value).

Property: message:http-version self

The HTTP protocol version to use.

Its value is a <SoupHTTPVersion>.

It is read only.

Property: message:is-options-ping self

Whether the message is an OPTIONS ping.

The Message is intended to be used to send OPTIONS * to a server. When set to #t, the path of Message:uri will be ignored and Message:method set to SOUP_METHOD_OPTIONS.

Its value is a boolean.

Set it with (set! (message:is-options-ping self) value).

Property: message:is-top-level-navigation self

Set when the message is navigating between top level domains.

Its value is a boolean.

Set it with (set! (message:is-top-level-navigation self) value).

Property: message:method self

The message’s HTTP method.

Its value is a string, or #f.

Set it with (set! (message:method self) value).

Property: message:priority self

Sets the priority of the Message. See Message.set_priority for further details.

Its value is a <SoupMessagePriority> (or, to set it, one of its symbols).

Set it with (set! (message:priority self) value).

Property: message:reason-phrase self

The HTTP response reason phrase.

Its value is a string, or #f.

It is read only.

Property: message:remote-address self

The remote <GSocketAddress> of the connection associated with the message.

Its value is a <GSocketAddress>, or #f.

It is read only.

Property: message:request-headers self

The HTTP request headers.

Its value is a <SoupMessageHeaders>, or #f.

It is read only.

Property: message:response-headers self

The HTTP response headers.

Its value is a <SoupMessageHeaders>, or #f.

It is read only.

Property: message:site-for-cookies self

Site used to compare cookies against. Used for SameSite cookie support.

Its value is a <GUri>, or #f.

Set it with (set! (message:site-for-cookies self) value).

Property: message:status-code self

The HTTP response status code.

Its value is an unsigned 32-bit integer.

It is read only.

Property: message:tls-ciphersuite-name self

The Name of TLS ciphersuite negotiated for this message connection.

Its value is a string, or #f.

It is read only.

Property: message:tls-peer-certificate self

The peer’s <GTlsCertificate> associated with the message.

Its value is a <GTlsCertificate>, or #f.

It is read only.

Property: message:tls-peer-certificate-errors self

The verification errors on Message:tls-peer-certificate.

Its value is a <GTlsCertificateFlags>.

It is read only.

Property: message:tls-protocol-version self

The TLS protocol version negotiated for the message connection.

Its value is a <GTlsProtocolVersion>.

It is read only.

Property: message:uri self

The message’s Request-URI.

Its value is a <GUri>, or #f.

Set it with (set! (message:uri self) value).

Procedures

Method: message:add-flags self flags
Method: add-flags self flags

Adds flags to the set of self’s flags.

self

Passed: a <SoupMessage>.

a <SoupMessage>

flags

Passed: a <SoupMessageFlags>, or a list of its symbols, or one of them.

a set of <SoupMessageFlags> values

Method: message:disable-feature self feature-type
Method: disable-feature self feature-type

Disables the actions of SessionFeatures with the given feature-type (or a subclass of that type) on self.

self is processed as though the feature(s) hadn’t been added to the session. Eg, passing SOUP_TYPE_CONTENT_SNIFFER for feature-type will disable Content-Type sniffing on the message.

You must call this before queueing self 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.

self

Passed: a <SoupMessage>.

a <SoupMessage>

feature-type

Passed: a class, or a GType number.

the GType of a SessionFeature

Method: message:get-connection-id self ⇒ %return
Method: get-connection-id self ⇒ %return

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.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: an unsigned 64-bit integer.

An id or 0 if no connection.

Method: message:get-first-party self ⇒ %return
Method: get-first-party self ⇒ %return

Gets self’s first-party <GUri>.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <GUri>.

the self’s first party <GUri>

Method: message:get-flags self ⇒ %return
Method: get-flags self ⇒ %return

Gets the flags on self.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <SoupMessageFlags>.

the flags

Method: message:get-force-http1? self ⇒ %return
Method: get-force-http1? self ⇒ %return

Returns whether HTTP/1 version is currently demanded for the self send.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: a boolean.

#t, when HTTP/1 is demanded, #f otherwise.

Method: message:get-http-version self ⇒ %return
Method: get-http-version self ⇒ %return

Gets the HTTP version of self.

This is the minimum of the version from the request and the version from the response.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <SoupHTTPVersion>.

the HTTP version

Method: message:get-is-options-ping? self ⇒ %return
Method: get-is-options-ping? self ⇒ %return

Gets whether self is intended to be used to send OPTIONS * to a server.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a boolean.

#t if the message is options ping, or #f otherwise

Method: message:get-is-top-level-navigation? self ⇒ %return
Method: get-is-top-level-navigation? self ⇒ %return

Returns if this message is set as a top level navigation.

Used for same-site policy checks.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a boolean.

Whether the current request is a top-level navitation

Method: message:get-method self ⇒ %return
Method: get-method self ⇒ %return

Returns the method of this message.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: a string.

A method such as SOUP_METHOD_GET

Method: message:get-metrics self ⇒ %return
Method: get-metrics self ⇒ %return

Get the MessageMetrics of self.

If the flag collect-metrics is not enabled for self this will return #f.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: a <SoupMessageMetrics>, or #f.

a <SoupMessageMetrics>

Method: message:get-priority self ⇒ %return
Method: get-priority self ⇒ %return

Retrieves the MessagePriority.

If not set this value defaults to normal.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <SoupMessagePriority>.

the priority of the message.

Method: message:get-reason-phrase self ⇒ %return
Method: get-reason-phrase self ⇒ %return

Returns the reason phrase for the status of this message.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: a string, or #f.

the phrase

Method: message:get-remote-address self ⇒ %return
Method: get-remote-address self ⇒ %return

Get the remote <GSocketAddress> of the connection associated with the message.

The returned address can be #f 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 <GProxyAddress>. If Session:remote-connectable is set the returned address id for the connection to the session’s remote connectable.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: a <GSocketAddress>, or #f.

a <GSocketAddress> or #f if the connection hasn’t been established

Method: message:get-request-headers self ⇒ %return
Method: get-request-headers self ⇒ %return

Returns the headers sent with the request.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: a <SoupMessageHeaders>.

The MessageHeaders

Method: message:get-response-headers self ⇒ %return
Method: get-response-headers self ⇒ %return

Returns the headers recieved with the response.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: a <SoupMessageHeaders>.

The MessageHeaders

Method: message:get-site-for-cookies self ⇒ %return
Method: get-site-for-cookies self ⇒ %return

Gets self’s site for cookies <GUri>.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <GUri>.

the self’s site for cookies <GUri>

Method: message:get-status self ⇒ %return
Method: get-status self ⇒ %return

Returns the set status of this message.

self

Passed: a <SoupMessage>.

The <SoupMessage>

%return

Returned: a <SoupStatus>.

The <SoupStatus>

Method: message:get-tls-ciphersuite-name self ⇒ %return
Method: get-tls-ciphersuite-name self ⇒ %return

Gets the name of the TLS ciphersuite negotiated for self’s connection.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a string.

the name of the TLS ciphersuite, or #f if self’s connection is not SSL.

Method: message:get-tls-peer-certificate self ⇒ %return
Method: get-tls-peer-certificate self ⇒ %return

Gets the peer’s <GTlsCertificate> associated with self’s connection.

Note that this is not set yet during the emission of "accept-certificate" signal.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <GTlsCertificate>, or #f.

self’s TLS peer certificate, or #f if self’s connection is not SSL.

Method: message:get-tls-peer-certificate-errors self ⇒ %return
Method: get-tls-peer-certificate-errors self ⇒ %return

Gets the errors associated with validating self’s TLS peer certificate. Note that this is not set yet during the emission of "accept-certificate" signal.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <GTlsCertificateFlags>.

a <GTlsCertificateFlags> with self’s TLS peer certificate errors.

Method: message:get-tls-protocol-version self ⇒ %return
Method: get-tls-protocol-version self ⇒ %return

Gets the TLS protocol version negotiated for self’s connection.

If the message connection is not SSL, unknown is returned.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <GTlsProtocolVersion>.

a <GTlsProtocolVersion>

Method: message:get-uri self ⇒ %return
Method: get-uri self ⇒ %return

Gets self’s URI.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a <GUri>.

the URI self is targeted for.

Method: message:is-feature-disabled? self feature-type ⇒ %return
Method: is-feature-disabled? self feature-type ⇒ %return

Get whether SessionFeatures of the given feature-type (or a subclass of that type) are disabled on self.

See Message.disable_feature.

self

Passed: a <SoupMessage>.

a <SoupMessage>

feature-type

Passed: a class, or a GType number.

the GType of a SessionFeature

%return

Returned: a boolean.

#t if feature is disabled, or #f otherwise.

Method: message:is-keepalive? self ⇒ %return
Method: is-keepalive? self ⇒ %return

Determines whether or not self’s connection can be kept alive for further requests after processing self.

The result is based on the HTTP version, Connection header, etc.

self

Passed: a <SoupMessage>.

a <SoupMessage>

%return

Returned: a boolean.

#t or #f.

Procedure: message:new method uri-string ⇒ %return

Creates a new empty Message, which will connect to uri.

method

Passed: a string.

the HTTP method for the created request

uri-string

Passed: a string.

the destination endpoint (as a string)

%return

Returned: a <SoupMessage>, or #f.

the new <SoupMessage> (or #f if uri could not be parsed).

Procedure: message:new-from-encoded-form method uri-string encoded-form ⇒ %return

Creates a new Message and sets it up to send the given encoded-form 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 encoded-form, that will be released with byte-array:free when no longer in use. See also form_encode, form_encode_hash and form_encode_datalist.

method

Passed: a string.

the HTTP method for the created request (GET, POST or PUT)

uri-string

Passed: a string.

the destination endpoint (as a string)

encoded-form

Passed: a string.

a encoded form

%return

Returned: a <SoupMessage>, or #f.

the new <SoupMessage>, or #f if uri-string could not be parsed or method is not "GET, "POST" or "PUT"

Procedure: message:new-from-multipart uri-string multipart ⇒ %return

Creates a new Message and sets it up to send multipart to uri-string via POST.

uri-string

Passed: a string.

the destination endpoint

multipart

Passed: a <SoupMultipart>.

a <SoupMultipart>

%return

Returned: a <SoupMessage>, or #f.

the new <SoupMessage>, or #f if uri-string could not be parsed

Procedure: message:new-from-uri method uri ⇒ %return

Creates a new empty Message, which will connect to uri.

method

Passed: a string.

the HTTP method for the created request

uri

Passed: a <GUri>.

the destination endpoint

%return

Returned: a <SoupMessage>.

the new <SoupMessage>

Procedure: message:new-options-ping base-uri ⇒ %return

Creates a new Message to send OPTIONS * to a server. The path of base-uri will be ignored.

base-uri

Passed: a <GUri>.

the destination endpoint

%return

Returned: a <SoupMessage>.

the new <SoupMessage>

Method: message:query-flags? self flags ⇒ %return
Method: query-flags? self flags ⇒ %return

Queries if flags are present in the set of self’s flags.

self

Passed: a <SoupMessage>.

a <SoupMessage>

flags

Passed: a <SoupMessageFlags>, or a list of its symbols, or one of them.

a set of <SoupMessageFlags> values

%return

Returned: a boolean.

#t if flags are enabled in self

Method: message:remove-flags self flags
Method: remove-flags self flags

Removes flags from the set of self’s flags.

self

Passed: a <SoupMessage>.

a <SoupMessage>

flags

Passed: a <SoupMessageFlags>, or a list of its symbols, or one of them.

a set of <SoupMessageFlags> values

Method: message:set-first-party self first-party
Method: set-first-party self first-party

Sets first-party as the main document <GUri> for self.

For details of when and how this is used refer to the documentation for CookieJarAcceptPolicy.

self

Passed: a <SoupMessage>.

a <SoupMessage>

first-party

Passed: a <GUri>.

the <GUri> for the self’s first party

Method: message:set-flags self flags
Method: set-flags self flags

Sets the specified flags on self.

self

Passed: a <SoupMessage>.

a <SoupMessage>

flags

Passed: a <SoupMessageFlags>, or a list of its symbols, or one of them.

a set of <SoupMessageFlags> values

Method: message:set-force-http1 self value
Method: set-force-http1 self value

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.

self

Passed: a <SoupMessage>.

The <SoupMessage>

value

Passed: a boolean.

value to set

Method: message:set-is-options-ping self is-options-ping
Method: set-is-options-ping self is-options-ping

Set whether self is intended to be used to send OPTIONS * to a server.

When set to #t, the path of Message:uri will be ignored and Message:method set to SOUP_METHOD_OPTIONS.

self

Passed: a <SoupMessage>.

a <SoupMessage>

is-options-ping

Passed: a boolean.

the value to set

Method: message:set-is-top-level-navigation self is-top-level-navigation
Method: set-is-top-level-navigation self is-top-level-navigation

Sets whether the current request is a top-level navitation.

See the same-site spec for more information.

self

Passed: a <SoupMessage>.

a <SoupMessage>

is-top-level-navigation

Passed: a boolean.

if #t indicate the current request is a top-level navigation

Method: message:set-method self method
Method: set-method self method

Set self’s HTTP method to method.

self

Passed: a <SoupMessage>.

a <SoupMessage>

method

Passed: a string.

the value to set

Method: message:set-priority self priority
Method: set-priority self priority

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.

self

Passed: a <SoupMessage>.

a <SoupMessage>

priority

Passed: a <SoupMessagePriority>, or one of its symbols.

the <SoupMessagePriority>

Method: message:set-request-body self content-type stream content-length
Method: set-request-body self content-type stream content-length

Set the request body of a Message.

If content-type is #f and stream is not #f the Content-Type header will not be changed if present. The request body needs to be set again in case self is restarted (in case of redirection or authentication).

self

Passed: a <SoupMessage>.

the message

content-type

Passed: a string, or #f.

MIME Content-Type of the body, or #f if unknown

stream

Passed: a <GInputStream>, or #f.

a <GInputStream> to read the request body from

content-length

Passed: a 64-bit integer.

the byte length of stream or -1 if unknown

Method: message:set-request-body-from-bytes self [content-type] [bytes]
Method: set-request-body-from-bytes self [content-type] [bytes]

Set the request body of a Message from <GBytes>.

If content-type is #f and bytes is not #f the Content-Type header will not be changed if present. The request body needs to be set again in case self is restarted (in case of redirection or authentication).

self

Passed: a <SoupMessage>.

the message

content-type

Passed, or left out: a string, or #f.

MIME Content-Type of the body, or #f if unknown

bytes

Passed, or left out: a <GBytes>, or #f.

a <GBytes> with the request body data

Method: message:set-site-for-cookies self [site-for-cookies]
Method: set-site-for-cookies self [site-for-cookies]

Sets site-for-cookies as the policy URL for same-site cookies for self.

It is either the URL of the top-level document or #f 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.

self

Passed: a <SoupMessage>.

a <SoupMessage>

site-for-cookies

Passed, or left out: a <GUri>, or #f.

the <GUri> for the self’s site for cookies

Method: message:set-tls-client-certificate self [certificate]
Method: set-tls-client-certificate self [certificate]

Sets the certificate to be used by self’s connection when a client certificate is requested during the TLS handshake.

You can call this as a response to "request-certificate" signal, or before the connection is started. If certificate is #f the handshake will continue without providing a GTlsCertificate. Note that the <GTlsCertificate> set by this function will be ignored if Session:tls-interaction is not #f.

self

Passed: a <SoupMessage>.

a <SoupMessage>

certificate

Passed, or left out: a <GTlsCertificate>, or #f.

the <GTlsCertificate> to set, or #f

Method: message:set-uri self uri
Method: set-uri self uri

Sets self’s URI to uri.

If self has already been sent and you want to re-send it with the new URI, you need to send it again.

self

Passed: a <SoupMessage>.

a <SoupMessage>

uri

Passed: a <GUri>.

the new <GUri>

Method: message:tls-client-certificate-password-request-complete self
Method: tls-client-certificate-password-request-complete self

Completes a certificate password request.

You must call this as a response to "request-certificate-password" signal, to notify self that the <GTlsPassword> has already been updated.

self

Passed: a <SoupMessage>.

a <SoupMessage>

Signals

Signal: message:accept-certificate

Connect a handler with (connect object message:accept-certificate handler). It is called as (handler self tls-peer-certificate tls-peer-errors) ⇒ %return.

Emitted during the msg’s connection TLS handshake after an unacceptable TLS certificate has been received.

You can return #t to accept tls-certificate despite tls-errors.

self

Passed: a <SoupMessage>.

tls-peer-certificate

Passed: a <GTlsCertificate>.

the peer’s <GTlsCertificate>

tls-peer-errors

Passed: a <GTlsCertificateFlags>.

the tls errors of tls-certificate

%return

Returned: a boolean.

#t to accept the TLS certificate and stop other handlers from being invoked, or #f to propagate the event further.

Signal: message:authenticate

Connect a handler with (connect object message:authenticate handler). It is called as (handler self auth retrying) ⇒ %return.

Emitted when the message requires authentication.

If credentials are available call Auth.authenticate on auth. If these credentials fail, the signal will be emitted again, with retrying set to #t, which will continue until you return without calling Auth.authenticate on auth.

Note that this may be emitted before msg’s body has been fully read.

You can authenticate auth asynchronously by calling object:ref on auth and returning #t. The operation will complete once either Auth.authenticate or Auth.cancel are called.

self

Passed: a <SoupMessage>.

auth

Passed: a <SoupAuth>.

the <SoupAuth> to authenticate

retrying

Passed: a boolean.

#t if this is the second (or later) attempt

%return

Returned: a boolean.

#t to stop other handlers from being invoked or #f to propagate the event further.

Signal: message:content-sniffed

Connect a handler with (connect object message:content-sniffed handler). It is called as (handler self type params).

This signal is emitted after "got-headers".

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 "got-headers", and type is #f.

self

Passed: a <SoupMessage>.

type

Passed: a string.

the content type that we got from sniffing

params

Passed: a hash table, each key a string and each value a string.

a <GHashTable> with the parameters

Signal: message:finished

Connect a handler with (connect object message:finished handler). It is called as (handler self).

Emitted when all HTTP processing is finished for a message.

(After "got_body").

self

Passed: a <SoupMessage>.

Signal: message:got-body

Connect a handler with (connect object message:got-body handler). It is called as (handler self).

Emitted after receiving the complete message response body.

self

Passed: a <SoupMessage>.

Signal: message:got-body-data

Connect a handler with (connect object message:got-body-data handler). It is called as (handler self chunk-size).

Emitted after reading a portion of the message body from the network.

self

Passed: a <SoupMessage>.

chunk-size

Passed: an unsigned 32-bit integer.

the number of bytes read

Signal: message:got-headers

Connect a handler with (connect object message:got-headers handler). It is called as (handler self).

Emitted after receiving the Status-Line and response headers.

See also Message.add_header_handler and 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 "got-body" handler rather than a "got_headers" handler, so that the existing HTTP connection can be reused.)

self

Passed: a <SoupMessage>.

Signal: message:got-informational

Connect a handler with (connect object message:got-informational handler). It is called as (handler self).

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.

self

Passed: a <SoupMessage>.

Signal: message:hsts-enforced

Connect a handler with (connect object message:hsts-enforced handler). It is called as (handler self).

Emitted when HSTSEnforcer has upgraded the protocol for msg to HTTPS as a result of matching its domain with a HSTS policy.

self

Passed: a <SoupMessage>.

Signal: message:network-event

Connect a handler with (connect object message:network-event handler). It is called as (handler self event connection).

Emitted to indicate that some network-related event related to msg has occurred.

This essentially proxies the socket-client: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 new-connection flag on it.)

See socket-client:event for more information on what the different values of event correspond to, and what connection will be in each case.

self

Passed: a <SoupMessage>.

event

Passed: a <GSocketClientEvent>.

the network event

connection

Passed: a <GIOStream>.

the current state of the network connection

Signal: message:request-certificate

Connect a handler with (connect object message:request-certificate handler). It is called as (handler self tls-connection) ⇒ %return.

Emitted during the msg’s connection TLS handshake when tls-connection requests a certificate from the client.

You can set the client certificate by calling Message.set_tls_client_certificate and returning #t. It’s possible to handle the request asynchornously by returning #t and call Message.set_tls_client_certificate later once the certificate is available. Note that this signal is not emitted if Session:tls-interaction was set, or if Message.set_tls_client_certificate was called before the connection TLS handshake started.

self

Passed: a <SoupMessage>.

tls-connection

Passed: a <GTlsClientConnection>.

the <GTlsClientConnection>

%return

Returned: a boolean.

#t to handle the request, or #f to make the connection fail with certificate-required.

Signal: message:request-certificate-password

Connect a handler with (connect object message:request-certificate-password handler). It is called as (handler self tls-password) ⇒ %return.

Emitted during the msg’s connection TLS handshake when tls-connection requests a certificate password from the client.

You can set the certificate password on password, then call Message.tls_client_certificate_password_request_complete and return #t to handle the signal synchronously. It’s possible to handle the request asynchornously by calling object:ref on password, then returning #t and call Message.tls_client_certificate_password_request_complete later after setting the password on password. Note that this signal is not emitted if Session:tls-interaction was set.

self

Passed: a <SoupMessage>.

tls-password

Passed: a <GTlsPassword>.

the <GTlsPassword>

%return

Returned: a boolean.

#t to handle the request, or #f to make the connection fail with certificate-required.

Signal: message:restarted

Connect a handler with (connect object message:restarted handler). It is called as (handler self).

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.

self

Passed: a <SoupMessage>.

Signal: message:starting

Connect a handler with (connect object message:starting handler). It is called as (handler self).

Emitted just before a message is sent.

self

Passed: a <SoupMessage>.

Signal: message:wrote-body

Connect a handler with (connect object message:wrote-body handler). It is called as (handler self).

Emitted immediately after writing the complete body for a message.

self

Passed: a <SoupMessage>.

Signal: message:wrote-body-data

Connect a handler with (connect object message:wrote-body-data handler). It is called as (handler self chunk-size).

Emitted immediately after writing a portion of the message body to the network.

self

Passed: a <SoupMessage>.

chunk-size

Passed: an unsigned 32-bit integer.

the number of bytes written

Signal: message:wrote-headers

Connect a handler with (connect object message:wrote-headers handler). It is called as (handler self).

Emitted immediately after writing the request headers for a message.

self

Passed: a <SoupMessage>.