Soup.Message

g GObject.Object GObject.Object Soup.Message Soup.Message GObject.Object->Soup.Message

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (method, uri_string)

class

new_from_encoded_form (method, uri_string, encoded_form)

class

new_from_multipart (uri_string, multipart)

class

new_from_uri (method, uri)

class

new_options_ping (base_uri)

add_flags (flags)

disable_feature (feature_type)

get_connection_id ()

get_first_party ()

get_flags ()

get_force_http1 ()

get_http_version ()

get_is_options_ping ()

get_is_top_level_navigation ()

get_method ()

get_metrics ()

get_priority ()

get_reason_phrase ()

get_remote_address ()

get_request_headers ()

get_response_headers ()

get_site_for_cookies ()

get_status ()

get_tls_ciphersuite_name ()

get_tls_peer_certificate ()

get_tls_peer_certificate_errors ()

get_tls_protocol_version ()

get_uri ()

is_feature_disabled (feature_type)

is_keepalive ()

query_flags (flags)

remove_flags (flags)

set_first_party (first_party)

set_flags (flags)

set_force_http1 (value)

set_is_options_ping (is_options_ping)

set_is_top_level_navigation (is_top_level_navigation)

set_method (method)

set_priority (priority)

set_request_body (content_type, stream, content_length)

set_request_body_from_bytes (content_type, bytes)

set_site_for_cookies (site_for_cookies)

set_tls_client_certificate (certificate)

set_uri (uri)

tls_client_certificate_password_request_complete ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

first-party

GLib.Uri

r/w

The URI loaded in the application when the message was requested.

flags

Soup.MessageFlags

r/w

Various message options

http-version

Soup.HTTPVersion

r

The HTTP protocol version to use

is-options-ping

bool

r/w

The message is an OPTIONS ping

is-top-level-navigation

bool

r/w

If the current messsage is navigating between top-levels

method

str

r/w

The message’s HTTP method

priority

Soup.MessagePriority

r/w

The priority of the message

reason-phrase

str

r

The HTTP response reason phrase

remote-address

Gio.SocketAddress

r

The remote address of the connection associated with the message

request-headers

Soup.MessageHeaders

r

The HTTP request headers

response-headers

Soup.MessageHeaders

r

The HTTP response headers

site-for-cookies

GLib.Uri

r/w

The URI for the site to compare cookies against

status-code

int

r

The HTTP response status code

tls-ciphersuite-name

str

r

Name of TLS ciphersuite negotiated for this connection

tls-peer-certificate

Gio.TlsCertificate

r

The TLS peer certificate associated with the message

tls-peer-certificate-errors

Gio.TlsCertificateFlags

r

The verification errors on the message’s TLS peer certificate

tls-protocol-version

Gio.TlsProtocolVersion

r

TLS protocol version negotiated for this connection

uri

GLib.Uri

r/w

The message’s Request-URI

Signals

Inherited:

GObject.Object (1)

Name

Short Description

accept-certificate

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

authenticate

Emitted when the message requires authentication.

content-sniffed

This signal is emitted after [signal`Message`:py:func:::got-headers<Soup.Message.signals.got_headers>].

finished

Emitted when all HTTP processing is finished for a message.

got-body

Emitted after receiving the complete message response body.

got-body-data

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

got-headers

Emitted after receiving the Status-Line and response headers.

got-informational

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

hsts-enforced

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

network-event

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

request-certificate

Emitted during the msg's connection TLS handshake when tls_connection requests a certificate from the client.

request-certificate-password

Emitted during the msg's connection TLS handshake when tls_connection requests a certificate password from the client.

restarted

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

starting

Emitted just before a message is sent.

wrote-body

Emitted immediately after writing the complete body for a message.

wrote-body-data

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

wrote-headers

Emitted immediately after writing the request headers for a message.

Fields

Inherited:

GObject.Object (1)

Class Details

class Soup.Message(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Soup.MessageClass

Represents an HTTP message being sent or received.

A Soup.Message represents an HTTP message that is being sent or received.

You would create a Soup.Message with [ctor`Message`.new] or [ctor`Message`.new_from_uri], set up its fields appropriately, and send it.

[property`Message`:py:data::status-code<Soup.Message.props.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`:py:data::reason-phrase<Soup.Message.props.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 [property`Message`:py:data::reason-phrase<Soup.Message.props.reason_phrase>] in user-visible messages. Rather, you should look at [property`Message`:py:data::status-code<Soup.Message.props.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 Soup.Message combines both the request and the response.

classmethod new(method, uri_string)
Parameters:
  • method (str) – the HTTP method for the created request

  • uri_string (str) – the destination endpoint (as a string)

Returns:

the new Soup.Message (or None if uri could not be parsed).

Return type:

Soup.Message or None

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

classmethod new_from_encoded_form(method, uri_string, encoded_form)
Parameters:
  • method (str) – the HTTP method for the created request (GET, POST or PUT)

  • uri_string (str) – the destination endpoint (as a string)

  • encoded_form (str) – a encoded form

Returns:

the new Soup.Message, or None if uri_string could not be parsed or method is not “GET, “POST” or “PUT”

Return type:

Soup.Message or None

Creates a new Soup.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 [func`GLib`.free] when no longer in use. See also [func`form_encode`], [func`form_encode_hash`] and [func`form_encode_datalist`].

classmethod new_from_multipart(uri_string, multipart)
Parameters:
Returns:

the new Soup.Message, or None if uri_string could not be parsed

Return type:

Soup.Message or None

Creates a new Soup.Message and sets it up to send multipart to uri_string via POST.

classmethod new_from_uri(method, uri)
Parameters:
  • method (str) – the HTTP method for the created request

  • uri (GLib.Uri) – the destination endpoint

Returns:

the new Soup.Message

Return type:

Soup.Message

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

classmethod new_options_ping(base_uri)
Parameters:

base_uri (GLib.Uri) – the destination endpoint

Returns:

the new Soup.Message

Return type:

Soup.Message

Creates a new Soup.Message to send OPTIONS * to a server. The path of base_uri will be ignored.

add_flags(flags)
Parameters:

flags (Soup.MessageFlags) – a set of Soup.MessageFlags values

Adds flags to the set of self's flags.

disable_feature(feature_type)
Parameters:

feature_type (GObject.GType) – the GObject.GType of a Soup.SessionFeature

Disables the actions of [iface`SessionFeature`]s 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.

get_connection_id()
Returns:

An id or 0 if no connection.

Return type:

int

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.

get_first_party()
Returns:

the self's first party GLib.Uri

Return type:

GLib.Uri

Gets self's first-party [struct`GLib`.Uri].

get_flags()
Returns:

the flags

Return type:

Soup.MessageFlags

Gets the flags on self.

get_force_http1()
Returns:

True, when HTTP/1 is demanded, False otherwise.

Return type:

bool

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

New in version 3.4.

get_http_version()
Returns:

the HTTP version

Return type:

Soup.HTTPVersion

Gets the HTTP version of self.

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

get_is_options_ping()
Returns:

True if the message is options ping, or False otherwise

Return type:

bool

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

get_is_top_level_navigation()
Returns:

Whether the current request is a top-level navitation

Return type:

bool

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

Used for same-site policy checks.

get_method()
Returns:

A method such as %SOUP_METHOD_GET

Return type:

str

Returns the method of this message.

get_metrics()
Returns:

a Soup.MessageMetrics

Return type:

Soup.MessageMetrics or None

Get the [struct`MessageMetrics`] of self.

If the flag Soup.MessageFlags.COLLECT_METRICS is not enabled for self this will return None.

get_priority()
Returns:

the priority of the message.

Return type:

Soup.MessagePriority

Retrieves the [enum`MessagePriority`].

If not set this value defaults to Soup.MessagePriority.NORMAL.

get_reason_phrase()
Returns:

the phrase

Return type:

str or None

Returns the reason phrase for the status of this message.

get_remote_address()
Returns:

a Gio.SocketAddress or None if the connection hasn’t been established

Return type:

Gio.SocketAddress or None

Get the remote [class`Gio`.SocketAddress] of the connection associated with the message.

The returned address can be None 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 [class`Gio`.ProxyAddress]. If [property`Session`:py:data::remote-connectable<Soup.Message.props.remote_connectable>] is set the returned address id for the connection to the session’s remote connectable.

get_request_headers()
Returns:

The Soup.MessageHeaders

Return type:

Soup.MessageHeaders

Returns the headers sent with the request.

get_response_headers()
Returns:

The Soup.MessageHeaders

Return type:

Soup.MessageHeaders

Returns the headers recieved with the response.

get_site_for_cookies()
Returns:

the self's site for cookies GLib.Uri

Return type:

GLib.Uri

Gets self's site for cookies GLib.Uri.

get_status()
Returns:

The Soup.Status

Return type:

Soup.Status

Returns the set status of this message.

get_tls_ciphersuite_name()
Returns:

the name of the TLS ciphersuite, or None if self's connection is not SSL.

Return type:

str

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

get_tls_peer_certificate()
Returns:

self's TLS peer certificate, or None if self's connection is not SSL.

Return type:

Gio.TlsCertificate or None

Gets the peer’s [class`Gio`.TlsCertificate] associated with self's connection.

Note that this is not set yet during the emission of [signal`Message`:py:func:::accept-certificate<Soup.Message.signals.accept_certificate>] signal.

get_tls_peer_certificate_errors()
Returns:

a Gio.TlsCertificateFlags with self's TLS peer certificate errors.

Return type:

Gio.TlsCertificateFlags

Gets the errors associated with validating self's TLS peer certificate. Note that this is not set yet during the emission of [signal`Message`:py:func:::accept-certificate<Soup.Message.signals.accept_certificate>] signal.

get_tls_protocol_version()
Returns:

a Gio.TlsProtocolVersion

Return type:

Gio.TlsProtocolVersion

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

If the message connection is not SSL, Gio.TlsProtocolVersion.UNKNOWN is returned.

get_uri()
Returns:

the URI self is targeted for.

Return type:

GLib.Uri

Gets self's URI.

is_feature_disabled(feature_type)
Parameters:

feature_type (GObject.GType) – the GObject.GType of a Soup.SessionFeature

Returns:

True if feature is disabled, or False otherwise.

Return type:

bool

Get whether [iface`SessionFeature`]s of the given feature_type (or a subclass of that type) are disabled on self.

See [method`Message`.disable_feature].

is_keepalive()
Returns:

True or False.

Return type:

bool

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.

query_flags(flags)
Parameters:

flags (Soup.MessageFlags) – a set of Soup.MessageFlags values

Returns:

True if flags are enabled in self

Return type:

bool

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

remove_flags(flags)
Parameters:

flags (Soup.MessageFlags) – a set of Soup.MessageFlags values

Removes flags from the set of self's flags.

set_first_party(first_party)
Parameters:

first_party (GLib.Uri) – the GLib.Uri for the self's first party

Sets first_party as the main document GLib.Uri for self.

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

set_flags(flags)
Parameters:

flags (Soup.MessageFlags) – a set of Soup.MessageFlags values

Sets the specified flags on self.

set_force_http1(value)
Parameters:

value (bool) – value to set

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.

New in version 3.4.

set_is_options_ping(is_options_ping)
Parameters:

is_options_ping (bool) – the value to set

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

When set to True, the path of [property`Message`:py:data::uri<Soup.Message.props.uri>] will be ignored and [property`Message`:py:data::method<Soup.Message.props.method>] set to %SOUP_METHOD_OPTIONS.

set_is_top_level_navigation(is_top_level_navigation)
Parameters:

is_top_level_navigation (bool) – if True indicate the current request is a top-level navigation

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

See the same-site spec for more information.

set_method(method)
Parameters:

method (str) – the value to set

Set self's HTTP method to method.

set_priority(priority)
Parameters:

priority (Soup.MessagePriority) – the Soup.MessagePriority

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.

set_request_body(content_type, stream, content_length)
Parameters:

Set the request body of a Soup.Message.

If content_type is None and stream is not None 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).

set_request_body_from_bytes(content_type, bytes)
Parameters:

Set the request body of a Soup.Message from [struct`GLib`.Bytes].

If content_type is None and bytes is not None 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).

set_site_for_cookies(site_for_cookies)
Parameters:

site_for_cookies (GLib.Uri or None) – the GLib.Uri for the self's 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 None 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.

set_tls_client_certificate(certificate)
Parameters:

certificate (Gio.TlsCertificate or None) – the Gio.TlsCertificate to set, or None

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 [signal`Message`:py:func:::request-certificate<Soup.Message.signals.request_certificate>] signal, or before the connection is started. If certificate is None the handshake will continue without providing a Gio.TlsCertificate. Note that the [class`Gio`.TlsCertificate] set by this function will be ignored if [property`Session`:py:data::tls-interaction<Soup.Message.props.tls_interaction>] is not None.

set_uri(uri)
Parameters:

uri (GLib.Uri) – the new GLib.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.

tls_client_certificate_password_request_complete()

Completes a certificate password request.

You must call this as a response to [signal`Message`:py:func:::request-certificate-password<Soup.Message.signals.request_certificate_password>] signal, to notify self that the [class`Gio`.TlsPassword] has already been updated.

Signal Details

Soup.Message.signals.accept_certificate(message, tls_peer_certificate, tls_peer_errors)
Signal Name:

accept-certificate

Flags:

RUN_LAST

Parameters:
Returns:

True to accept the TLS certificate and stop other handlers from being invoked, or False to propagate the event further.

Return type:

bool

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

You can return True to accept tls_certificate despite tls_errors.

Soup.Message.signals.authenticate(message, auth, retrying)
Signal Name:

authenticate

Flags:

RUN_LAST

Parameters:
Returns:

True to stop other handlers from being invoked or False to propagate the event further.

Return type:

bool

Emitted when the message requires authentication.

If credentials are available call [method`Auth`.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 [method`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 [method`GObject`.Object.ref] on auth and returning True. The operation will complete once either [method`Auth`.authenticate] or [method`Auth`.cancel] are called.

Soup.Message.signals.content_sniffed(message, type, params)
Signal Name:

content-sniffed

Flags:

RUN_FIRST

Parameters:
  • message (Soup.Message) – The object which received the signal

  • type (str) – the content type that we got from sniffing

  • params ({str: str}) – a GLib.HashTable with the parameters

This signal is emitted after [signal`Message`:py:func:::got-headers<Soup.Message.signals.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 [signal`Message`:py:func:::got-headers<Soup.Message.signals.got_headers>], and type is None.

Soup.Message.signals.finished(message)
Signal Name:

finished

Flags:

RUN_FIRST

Parameters:

message (Soup.Message) – The object which received the signal

Emitted when all HTTP processing is finished for a message.

(After [signal`Message`::got_body]).

Soup.Message.signals.got_body(message)
Signal Name:

got-body

Flags:

RUN_FIRST

Parameters:

message (Soup.Message) – The object which received the signal

Emitted after receiving the complete message response body.

Soup.Message.signals.got_body_data(message, chunk_size)
Signal Name:

got-body-data

Flags:

RUN_FIRST

Parameters:
  • message (Soup.Message) – The object which received the signal

  • chunk_size (int) – the number of bytes read

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

New in version 3.4.

Soup.Message.signals.got_headers(message)
Signal Name:

got-headers

Flags:

RUN_FIRST

Parameters:

message (Soup.Message) – The object which received the signal

Emitted after receiving the Status-Line and response headers.

See also [method`Message`.add_header_handler] and [method`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 [signal`Message`:py:func:::got-body<Soup.Message.signals.got_body>] handler rather than a [signal`Message`::got_headers] handler, so that the existing HTTP connection can be reused.)

Soup.Message.signals.got_informational(message)
Signal Name:

got-informational

Flags:

RUN_FIRST

Parameters:

message (Soup.Message) – The object which received the signal

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.

Soup.Message.signals.hsts_enforced(message)
Signal Name:

hsts-enforced

Flags:

RUN_LAST

Parameters:

message (Soup.Message) – The object which received the signal

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

Soup.Message.signals.network_event(message, event, connection)
Signal Name:

network-event

Flags:

RUN_FIRST

Parameters:

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

This essentially proxies the [signal`Gio`.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 Soup.MessageFlags.NEW_CONNECTION flag on it.)

See [signal`Gio`.SocketClient::event] for more information on what the different values of event correspond to, and what connection will be in each case.

Soup.Message.signals.request_certificate(message, tls_connection)
Signal Name:

request-certificate

Flags:

RUN_LAST

Parameters:
Returns:

True to handle the request, or False to make the connection fail with Gio.TlsError.CERTIFICATE_REQUIRED.

Return type:

bool

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 [method`Message`.set_tls_client_certificate] and returning True. It’s possible to handle the request asynchornously by returning True and call [method`Message`.set_tls_client_certificate] later once the certificate is available. Note that this signal is not emitted if [property`Session`:py:data::tls-interaction<Soup.Message.props.tls_interaction>] was set, or if [method`Message`.set_tls_client_certificate] was called before the connection TLS handshake started.

Soup.Message.signals.request_certificate_password(message, tls_password)
Signal Name:

request-certificate-password

Flags:

RUN_LAST

Parameters:
Returns:

True to handle the request, or False to make the connection fail with Gio.TlsError.CERTIFICATE_REQUIRED.

Return type:

bool

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 [method`Message`.tls_client_certificate_password_request_complete] and return True to handle the signal synchronously. It’s possible to handle the request asynchornously by calling [method`GObject`.Object.ref] on password, then returning True and call [method`Message`.tls_client_certificate_password_request_complete] later after setting the password on password. Note that this signal is not emitted if [property`Session`:py:data::tls-interaction<Soup.Message.props.tls_interaction>] was set.

Soup.Message.signals.restarted(message)
Signal Name:

restarted

Flags:

RUN_FIRST

Parameters:

message (Soup.Message) – The object which received the signal

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.

Soup.Message.signals.starting(message)
Signal Name:

starting

Flags:

RUN_FIRST

Parameters:

message (Soup.Message) – The object which received the signal

Emitted just before a message is sent.

Soup.Message.signals.wrote_body(message)
Signal Name:

wrote-body

Flags:

RUN_FIRST

Parameters:

message (Soup.Message) – The object which received the signal

Emitted immediately after writing the complete body for a message.

Soup.Message.signals.wrote_body_data(message, chunk_size)
Signal Name:

wrote-body-data

Flags:

RUN_FIRST

Parameters:
  • message (Soup.Message) – The object which received the signal

  • chunk_size (int) – the number of bytes written

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

Soup.Message.signals.wrote_headers(message)
Signal Name:

wrote-headers

Flags:

RUN_FIRST

Parameters:

message (Soup.Message) – The object which received the signal

Emitted immediately after writing the request headers for a message.

Property Details

Soup.Message.props.first_party
Name:

first-party

Type:

GLib.Uri

Default Value:

None

Flags:

READABLE, WRITABLE

The [struct`GLib`.Uri] loaded in the application when the message was queued.

Soup.Message.props.flags
Name:

flags

Type:

Soup.MessageFlags

Default Value:

0

Flags:

READABLE, WRITABLE

Various message options.

Soup.Message.props.http_version
Name:

http-version

Type:

Soup.HTTPVersion

Default Value:

Soup.HTTPVersion.HTTP_1_1

Flags:

READABLE

The HTTP protocol version to use.

Soup.Message.props.is_options_ping
Name:

is-options-ping

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether the message is an OPTIONS ping.

The Soup.Message is intended to be used to send OPTIONS * to a server. When set to True, the path of [property`Message`:py:data::uri<Soup.Message.props.uri>] will be ignored and [property`Message`:py:data::method<Soup.Message.props.method>] set to %SOUP_METHOD_OPTIONS.

Soup.Message.props.is_top_level_navigation
Name:

is-top-level-navigation

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Set when the message is navigating between top level domains.

Soup.Message.props.method
Name:

method

Type:

str

Default Value:

'GET'

Flags:

READABLE, WRITABLE

The message’s HTTP method.

Soup.Message.props.priority
Name:

priority

Type:

Soup.MessagePriority

Default Value:

Soup.MessagePriority.NORMAL

Flags:

READABLE, WRITABLE

Sets the priority of the Soup.Message. See [method`Message`.set_priority] for further details.

Soup.Message.props.reason_phrase
Name:

reason-phrase

Type:

str

Default Value:

None

Flags:

READABLE

The HTTP response reason phrase.

Soup.Message.props.remote_address
Name:

remote-address

Type:

Gio.SocketAddress

Default Value:

None

Flags:

READABLE

The remote [class`Gio`.SocketAddress] of the connection associated with the message.

Soup.Message.props.request_headers
Name:

request-headers

Type:

Soup.MessageHeaders

Default Value:

None

Flags:

READABLE

The HTTP request headers.

Soup.Message.props.response_headers
Name:

response-headers

Type:

Soup.MessageHeaders

Default Value:

None

Flags:

READABLE

The HTTP response headers.

Soup.Message.props.site_for_cookies
Name:

site-for-cookies

Type:

GLib.Uri

Default Value:

None

Flags:

READABLE, WRITABLE

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

Soup.Message.props.status_code
Name:

status-code

Type:

int

Default Value:

0

Flags:

READABLE

The HTTP response status code.

Soup.Message.props.tls_ciphersuite_name
Name:

tls-ciphersuite-name

Type:

str

Default Value:

None

Flags:

READABLE

The Name of TLS ciphersuite negotiated for this message connection.

Soup.Message.props.tls_peer_certificate
Name:

tls-peer-certificate

Type:

Gio.TlsCertificate

Default Value:

None

Flags:

READABLE

The peer’s [class`Gio`.TlsCertificate] associated with the message.

Soup.Message.props.tls_peer_certificate_errors
Name:

tls-peer-certificate-errors

Type:

Gio.TlsCertificateFlags

Default Value:

Gio.TlsCertificateFlags.NO_FLAGS

Flags:

READABLE

The verification errors on [property`Message`:py:data::tls-peer-certificate<Soup.Message.props.tls_peer_certificate>].

Soup.Message.props.tls_protocol_version
Name:

tls-protocol-version

Type:

Gio.TlsProtocolVersion

Default Value:

Gio.TlsProtocolVersion.UNKNOWN

Flags:

READABLE

The TLS protocol version negotiated for the message connection.

Soup.Message.props.uri
Name:

uri

Type:

GLib.Uri

Default Value:

None

Flags:

READABLE, WRITABLE

The message’s Request-URI.