Message
Object Hierarchy:
Soup.Message
Soup.Message
Soup.Message
GLib.Object
GLib.Object
GLib.Object->Soup.Message
Description:
[ CCode ( type_id = "soup_message_get_type ()" ) ]public sealed class Message : Object
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 [[email protected] ] or [[email protected] _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 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:reason-phrase] in user-visible
messages. Rather, you should look at [property@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.
Content:
Properties:
Creation methods:
public Message (string method, string uri_string)
Creates a new empty Message , which will
connect to uri
.
public Message.from_encoded_form (string method, string uri_string, owned string encoded_form)
Creates a new Message and sets it up to
send the given encoded_form
to uri
via method
.
public Message.from_multipart (string uri_string, Multipart multipart)
Creates a new Message and sets it up to
send multipart
to uri_string
via POST.
public Message.from_uri (string method, Uri uri)
Creates a new empty Message , which will
connect to uri
.
public Message.options_ping (Uri base_uri)
Creates a new Message to send `OPTIONS *`
to a server.
Methods:
Signals:
public signal bool accept_certificate (TlsCertificate tls_peer_certificate, TlsCertificateFlags tls_peer_errors)
Emitted during the msg
's connection TLS handshake after
an unacceptable TLS certificate has been received.
public signal bool authenticate (Auth auth, bool retrying)
Emitted when the message requires authentication.
public signal void content_sniffed (string type, HashTable <string ,string > @params)
This signal is emitted after [signal@Message:
SoupMessage:got-headers
s].
public signal void finished ()
Emitted when all HTTP processing is finished for a message.
public signal void got_body ()
Emitted after receiving the complete message request body.
public signal void got_headers ()
Emitted after receiving the Status-Line and response headers.
public signal void got_informational ()
Emitted after receiving a 1xx (Informational) response for a (
client-side) message.
public signal void 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.
public signal void network_event (SocketClientEvent event, IOStream connection)
Emitted to indicate that some network-related event related to
msg
has occurred.
public signal bool request_certificate (TlsClientConnection tls_connection)
Emitted during the msg
's connection TLS handshake when
tls_connection
requests a certificate from the client.
public signal bool request_certificate_password (TlsPassword tls_password)
Emitted during the msg
's connection TLS handshake when
tls_connection
requests a certificate password from the client.
public signal void restarted ()
Emitted when a request that was already sent once is now being sent
again.
public signal void starting ()
Emitted just before a message is sent.
public signal void wrote_body ()
Emitted immediately after writing the complete body for a message.
public signal void wrote_body_data (uint chunk_size)
Emitted immediately after writing a portion of the message body to the
network.
public signal void wrote_headers ()
Emitted immediately after writing the request headers for a message.
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref