Class
SoupServerMessage
Description [src]
final class Soup.ServerMessage : GObject.Object {
/* No available fields */
}
An HTTP server request and response pair.
A SoupServerMessage represents an HTTP message that is being sent or
received on a SoupServer
.
SoupServer
will create SoupServerMessage
s automatically for
incoming requests, which your application will receive via handlers.
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 SoupServerMessage
combines both the request and the response.
Instance methods
soup_server_message_get_local_address
Retrieves the GSocketAddress
associated with the local end
of a connection.
soup_server_message_get_remote_address
Retrieves the GSocketAddress
associated with the remote end
of a connection.
soup_server_message_get_remote_host
Retrieves the IP address associated with the remote end of a connection.
soup_server_message_get_tls_peer_certificate
Gets the peer’s GTlsCertificate
associated with msg
‘s connection.
Note that this is not set yet during the emission of
SoupServerMessage::accept-certificate signal.
since: 3.2
soup_server_message_get_tls_peer_certificate_errors
Gets the errors associated with validating msg
‘s TLS peer certificate.
Note that this is not set yet during the emission of
SoupServerMessage::accept-certificate signal.
since: 3.2
soup_server_message_set_redirect
Sets msg
‘s status_code to status_code
and adds a Location header
pointing to redirect_uri
. Use this from a SoupServer
when you
want to redirect the client to another URI.
soup_server_message_set_response
Convenience function to set the response body of a SoupServerMessage
. If
content_type
is NULL
, the response body must be empty as well.
soup_server_message_steal_connection
“Steals” the HTTP connection associated with msg
from its SoupServer
. This
happens immediately, regardless of the current state of the connection; if
the response to msg
has not yet finished being sent, then it will be
discarded; you can steal the connection from a
SoupServerMessage::wrote-informational
or
SoupServerMessage::wrote-body
signal handler if you need to wait for
part or all of the response to be sent.
Properties
Soup.ServerMessage:tls-peer-certificate
The peer’s GTlsCertificate
associated with the message.
since: 3.2
Soup.ServerMessage:tls-peer-certificate-errors
The verification errors on SoupServerMessage:tls-peer-certificate
.
since: 3.2
Signals
Soup.ServerMessage::accept-certificate
Emitted during the msg
‘s connection TLS handshake
after client TLS certificate has been received.
You can return TRUE
to accept tls_certificate
despite
tls_errors
.
Soup.ServerMessage::connected
Emitted when the msg
‘s socket is connected and the TLS handshake completed.
Soup.ServerMessage::finished
Emitted when all HTTP processing is finished for a message.
(After SoupServerMessage::wrote-body
).
Soup.ServerMessage::wrote-body
Emitted immediately after writing the complete response body for a message.
Soup.ServerMessage::wrote-body-data
Emitted immediately after writing a portion of the message body to the network.
Soup.ServerMessage::wrote-headers
Emitted immediately after writing the response headers for a message.
Soup.ServerMessage::wrote-informational
Emitted immediately after writing a 1xx (Informational) response.
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.