Message

class Message(pointer: <Error class: unknown class><<Error class: unknown class>>)

Represents an HTTP message being sent or received.

A #SoupMessage represents an HTTP message that is being sent or received.

You would create a #SoupMessage with ctor@Message.new or ctor@Message.new_from_uri, set up its fields appropriately, and send it.

property@Message:status-code will normally be a enum@Status value, eg, %SOUP_STATUS_OK, though of course it might actually be an unknown status code. property@Message:reason-phrase is the actual text returned from the server, which may or may not correspond to the "standard" description of

Constructors

Link copied to clipboard
constructor(method: String, uriString: String)

Creates a new empty #SoupMessage, which will connect to @uri.

constructor(method: String, uriString: String, encodedForm: String)

Creates a new #SoupMessage 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.

constructor(uriString: String, multipart: Multipart)

Creates a new #SoupMessage and sets it up to send @multipart to

constructor(method: String, uri: <Error class: unknown class>)

Creates a new empty #SoupMessage, which will connect to @uri.

constructor(baseUri: <Error class: unknown class>)

Creates a new #SoupMessage to send OPTIONS * to a server. The path of

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var firstParty: <Error class: unknown class>

The struct@GLib.Uri loaded in the application when the message was queued.

Link copied to clipboard

Various message options.

Link copied to clipboard

The HTTP protocol version to use.

Link copied to clipboard

Whether the message is an OPTIONS ping.

Link copied to clipboard

Set when the message is navigating between top level domains.

Link copied to clipboard

The message's HTTP method.

Link copied to clipboard

Sets the priority of the #SoupMessage. See method@Message.set_priority for further details.

Link copied to clipboard

The HTTP response reason phrase.

Link copied to clipboard
val remoteAddress: <Error class: unknown class>?

The remote class@Gio.SocketAddress of the connection associated with the message.

Link copied to clipboard

The HTTP request headers.

Link copied to clipboard

The HTTP response headers.

Link copied to clipboard
val soupMessagePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

The Name of TLS ciphersuite negotiated for this message connection.

Link copied to clipboard
val tlsPeerCertificate: <Error class: unknown class>?

The peer's class@Gio.TlsCertificate associated with the message.

Link copied to clipboard
val tlsPeerCertificateErrors: <Error class: unknown class>

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

Link copied to clipboard
val tlsProtocolVersion: <Error class: unknown class>

The TLS protocol version negotiated for the message connection.

Link copied to clipboard
var uri: <Error class: unknown class>

The message's Request-URI.

Functions

Link copied to clipboard

Adds @flags to the set of @msg's flags.

Link copied to clipboard
fun addHeaderHandler(signal: String, header: String, callback: <Error class: unknown class>): <Error class: unknown class>

Adds a signal handler to @msg for @signal.

Link copied to clipboard
fun addStatusCodeHandler(signal: String, statusCode: <Error class: unknown class>, callback: <Error class: unknown class>): <Error class: unknown class>

Adds a signal handler to @msg for @signal.

Link copied to clipboard
fun connectAcceptCertificate(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>) -> Boolean): <Error class: unknown class>

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

Link copied to clipboard
fun connectAuthenticate(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (auth: Auth, retrying: Boolean) -> Boolean): <Error class: unknown class>

Emitted when the message requires authentication.

Link copied to clipboard
fun connectContentSniffed(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (type: String, <Error class: unknown class>) -> Unit): <Error class: unknown class>

This signal is emitted after signal@Message::got-headers.

Link copied to clipboard
fun connectFinished(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when all HTTP processing is finished for a message.

Link copied to clipboard
fun connectGotBody(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted after receiving the complete message response body.

Link copied to clipboard
fun connectGotBodyData(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>) -> Unit): <Error class: unknown class>

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

Link copied to clipboard
fun connectGotHeaders(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted after receiving the Status-Line and response headers.

Link copied to clipboard
fun connectGotInformational(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted after receiving a 1xx (Informational) response for a (client-side) message.

Link copied to clipboard
fun connectHstsEnforced(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

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

Link copied to clipboard
fun connectNetworkEvent(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>) -> Unit): <Error class: unknown class>

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

Link copied to clipboard
fun connectRequestCertificate(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>) -> Boolean): <Error class: unknown class>

Emitted during the @msg's connection TLS handshake when

Link copied to clipboard
fun connectRequestCertificatePassword(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>) -> Boolean): <Error class: unknown class>

Emitted during the @msg's connection TLS handshake when

Link copied to clipboard
fun connectRestarted(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted when a request that was already sent once is now being sent again.

Link copied to clipboard
fun connectStarting(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted just before a message is sent.

Link copied to clipboard
fun connectWroteBody(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted immediately after writing the complete body for a message.

Link copied to clipboard
fun connectWroteBodyData(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>) -> Unit): <Error class: unknown class>

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

Link copied to clipboard
fun connectWroteHeaders(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> Unit): <Error class: unknown class>

Emitted immediately after writing the request headers for a message.

Link copied to clipboard
fun disableFeature(featureType: <Error class: unknown class>)

Disables the actions of iface@SessionFeatures with the given @feature_type (or a subclass of that type) on @msg.

Link copied to clipboard
fun getConnectionId(): <Error class: unknown class>

Returns the unique idenfier for the last connection used.

Link copied to clipboard

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

Link copied to clipboard

Get the struct@MessageMetrics of @msg.

Link copied to clipboard
fun getSiteForCookies(): <Error class: unknown class>

Gets @msg's site for cookies #GUri.

Link copied to clipboard

Returns the set status of this message.

Link copied to clipboard
fun isFeatureDisabled(featureType: <Error class: unknown class>): Boolean

Get whether iface@SessionFeatures of the given @feature_type (or a subclass of that type) are disabled on @msg.

Link copied to clipboard

Determines whether or not @msg's connection can be kept alive for further requests after processing @msg.

Link copied to clipboard

Queries if @flags are present in the set of @msg's flags.

Link copied to clipboard

Removes @flags from the set of @msg's flags.

Link copied to clipboard

Sets whether HTTP/1 version should be used when sending this message. Some connections can still override it, if needed.

Link copied to clipboard
fun setRequestBody(contentType: String? = null, stream: <Error class: unknown class>? = null, contentLength: Long)

Set the request body of a #SoupMessage.

Link copied to clipboard
fun setRequestBodyFromBytes(contentType: String? = null, bytes: <Error class: unknown class>? = null)

Set the request body of a #SoupMessage from struct@GLib.Bytes.

Link copied to clipboard
fun setSiteForCookies(siteForCookies: <Error class: unknown class>? = null)

Sets @site_for_cookies as the policy URL for same-site cookies for @msg.

Link copied to clipboard
fun setTlsClientCertificate(certificate: <Error class: unknown class>? = null)

Sets the @certificate to be used by @msg's connection when a client certificate is requested during the TLS handshake.

Completes a certificate password request.