soup.server_message

Module for [ServerMessage] class

Types 3

An HTTP server request and response pair.

A SoupServerMessage represents an HTTP message that is being sent or received on a soup.server.Server.

soup.server.Server will create soup.server_message.ServerMessages 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.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
ServerMessage self() nothrowReturns `this`, for use in `with` statements.
ServerMessageGidBuilder builder() static nothrowGet builder for [soup.server_message.ServerMessage] Returns: New builder object
gio.tls_certificate.TlsCertificate tlsPeerCertificate() @property nothrowGet `tlsPeerCertificate` property. Returns: The peer's #GTlsCertificate associated with the message
gio.types.TlsCertificateFlags tlsPeerCertificateErrors() @property nothrowGet `tlsPeerCertificateErrors` property. Returns: The verification errors on #SoupServerMessage:tls-peer-certificate
soup.types.HTTPVersion getHttpVersion() nothrowGet the HTTP version of msg. Returns: a #SoupHTTPVersion.
gio.socket_address.SocketAddress getLocalAddress() nothrowRetrieves the [gio.socket_address.SocketAddress] associated with the local end of a connection. Returns: the #GSocketAddress associated with the local end of a connection, it may be null if you use...
string getMethod() nothrowGet the HTTP method of msg. Returns: the HTTP method.
string getReasonPhrase() nothrowGet the HTTP reason phrase of msg. Returns: the reason phrase.
gio.socket_address.SocketAddress getRemoteAddress() nothrowRetrieves the [gio.socket_address.SocketAddress] associated with the remote end of a connection. Returns: the #GSocketAddress associated with the remote end of a connection, it may be null if you u...
string getRemoteHost() nothrowRetrieves the IP address associated with the remote end of a connection. Returns: the IP address associated with the remote end of a connection, it may be null if you used [soup.server.Server.accep...
soup.message_body.MessageBody getRequestBody() nothrowGet the request body of msg. Returns: a #SoupMessageBody.
soup.message_headers.MessageHeaders getRequestHeaders() nothrowGet the request headers of msg. Returns: a #SoupMessageHeaders with the request headers.
soup.message_body.MessageBody getResponseBody() nothrowGet the response body of msg. Returns: a #SoupMessageBody.
soup.message_headers.MessageHeaders getResponseHeaders() nothrowGet the response headers of msg. Returns: a #SoupMessageHeaders with the response headers.
gio.socket.Socket getSocket() nothrowRetrieves the [gio.socket.Socket] that msg is associated with.
uint getStatus() nothrowGet the HTTP status code of msg. Returns: the HTTP status code.
gio.tls_certificate.TlsCertificate getTlsPeerCertificate() nothrowGets the peer's #GTlsCertificate associated with msg's connection. Note that this is not set yet during the emission of SoupServerMessage::accept-certificate signal. Returns: msg's TLS peer certifi...
gio.types.TlsCertificateFlags getTlsPeerCertificateErrors() nothrowGets 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. Returns: a #GTlsCertificate...
glib.uri.Uri getUri() nothrowGet msg's URI. Returns: a #GUri
bool isOptionsPing() nothrowGets if msg represents an OPTIONS message with the path `*`. Returns: true if is an OPTIONS ping
void pause() nothrowPauses I/O on msg.
void setHttpVersion(soup.types.HTTPVersion version_) nothrowSet the HTTP version of msg.
void setRedirect(uint statusCode, string redirectUri) nothrowSets msg's status_code to status_code and adds a Location header pointing to redirect_uri. Use this from a [soup.server.Server] when you want to redirect the client to another URI.
void setResponse(string contentType, soup.types.MemoryUse respUse, ubyte[] respBody = null) nothrowConvenience function to set the response body of a #SoupServerMessage. If content_type is null, the response body must be empty as well.
void setStatus(uint statusCode, string reasonPhrase = null) nothrowSets msg's status code to status_code.
gio.iostream.IOStream stealConnection() nothrow"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...
void unpause() nothrowResumes I/O on msg.
gulong connectAcceptCertificate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gio.tls_certificate.TlsCertificate))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == gio.types.TlsCertificateFlags))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : soup.server_message.ServerMessage))) && Parameters!T.length < 4) nothrowConnect to `AcceptCertificate` signal.
gulong connectConnected(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `Connected` signal.
gulong connectDisconnected(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `Disconnected` signal.
gulong connectFinished(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `Finished` signal.
gulong connectGotBody(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `GotBody` signal.
gulong connectGotChunk(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == glib.bytes.Bytes))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : soup.server_message.ServerMessage))) && Parameters!T.length < 3) nothrowConnect to `GotChunk` signal.
gulong connectGotHeaders(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `GotHeaders` signal.
gulong connectWroteBody(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `WroteBody` signal.
gulong connectWroteBodyData(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == uint))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : soup.server_message.ServerMessage))) && Parameters!T.length < 3) nothrowConnect to `WroteBodyData` signal.
gulong connectWroteChunk(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `WroteChunk` signal.
gulong connectWroteHeaders(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `WroteHeaders` signal.
gulong connectWroteInformational(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : soup.server_message.ServerMessage))) && Parameters!T.length < 2) nothrowConnect to `WroteInformational` signal.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
ServerMessage build() nothrowCreate object from builder. Returns: New object