- public unowned TimeoutSource add_completion (MainContext? async_context, SourceFunc function)
Adds function
to be executed from inside
async_context
with the default priority.
- public unowned TimeoutSource add_idle (MainContext? async_context, SourceFunc function)
Adds an idle event as with g_idle_add
, but using the
given async_context
.
- public unowned TimeoutSource add_io_watch (MainContext? async_context, IOChannel chan, IOCondition condition, IOFunc function)
Adds an I/O watch as with add_watch, but
using the given async_context
.
- public unowned TimeoutSource add_timeout (MainContext? async_context, uint interval, SourceFunc function)
Adds a timeout as with g_timeout_add
, but using the given
async_context
.
- public bool check_version (uint major, uint minor, uint micro)
Like SOUP_CHECK_VERSION, but the check for soup_check_version is at
runtime instead of compile time.
- public Cookie? cookie_parse (string header, URI origin)
Parses header
and returns a
Cookie.
- public SList<Cookie> cookies_from_request (Message msg)
Parses msg
's Cookie request header and returns a
SList of Cookies.
- public SList<Cookie> cookies_from_response (Message msg)
Parses msg
's Set-Cookie response headers and returns a
SList of Cookies.
- public string cookies_to_cookie_header (SList<Cookie> cookies)
Serializes a SList of
Cookie into a string suitable for setting as the value of the "Cookie" header.
- public void cookies_to_request (SList<Cookie> cookies, Message msg)
Adds the name and value of each cookie in cookies
to
msg
's "Cookie" request.
- public void cookies_to_response (SList<Cookie> cookies, Message msg)
Appends a "Set-Cookie" response header to msg
for each
cookie in cookies
.
- public uint get_major_version ()
Returns the major version number of the libsoup library.
- public uint get_micro_version ()
Returns the micro version number of the libsoup library.
- public uint get_minor_version ()
Returns the minor version number of the libsoup library.
- public Resource get_resource ()
- public bool header_contains (string header, string token)
Parses header
to see if it contains the token token
(matched case-insensitively).
- public void header_free_param_list (HashTable<string,string> param_list)
Frees param_list
.
- public void header_g_string_append_param (StringBuilder string, string name, string value)
Appends something like name
=value
to
string
, taking care to quote value
if needed, and if so, to escape any quotes or backslashes in value
.
- public void header_g_string_append_param_quoted (StringBuilder string, string name, string value)
Appends something like name
="value
"
to string
, taking care to escape any quotes or backslashes in value
.
- public SList<string> header_parse_list (string header)
Parses a header whose content is described by RFC2616 as "#something",
where "something" does not itself contain commas, except as part of quoted-strings.
- public HashTable<string,string> header_parse_param_list (string header)
Parses a header which is a comma-delimited list of something like:
token [ "=" ( token | quoted-string ) ].
- public HashTable<string,string>? header_parse_param_list_strict (string header)
- public SList<string> header_parse_quality_list (string header, out SList<string> unacceptable)
Parses a header whose content is a list of items with optional
"qvalue"s (eg, Accept, Accept-Charset, Accept-Encoding, Accept-Language, TE).
- public HashTable<string,string> header_parse_semi_param_list (string header)
Parses a header which is a semicolon-delimited list of something like:
token [ "=" ( token | quoted-string ) ].
- public HashTable<string,string>? header_parse_semi_param_list_strict (string header)
- public bool headers_parse (string str, int len, MessageHeaders dest)
Parses the headers of an HTTP request or response in str
and stores the results in dest
.
- public uint headers_parse_request (string str, int len, MessageHeaders req_headers, out string req_method, out string req_path, out HTTPVersion ver)
Parses the headers of an HTTP request in str
and stores
the results in req_method
, req_path
, ver
, and req_headers
.
- public bool headers_parse_response (string str, int len, MessageHeaders headers, out HTTPVersion ver, out uint status_code, out string reason_phrase)
Parses the headers of an HTTP response in str
and stores
the results in ver
, status_code
, reason_phrase
, and headers
.
- public bool headers_parse_status_line (string status_line, out HTTPVersion ver, out uint status_code, out string reason_phrase)
Parses the HTTP Status-Line string in status_line
into
ver
, status_code
, and reason_phrase
.
- public Quark http_error_quark ()
- public void message_headers_iter_init (out MessageHeadersIter iter, MessageHeaders hdrs)
- public Quark request_error_quark ()
- public Quark requester_error_quark ()
- public unowned string status_get_phrase (uint status_code)
- public uint status_proxify (uint status_code)
- public bool str_case_equal (void* v1, void* v2)
Compares v1
and v2
in a case-insensitive
manner
- public uint str_case_hash (void* key)
Hashes key
in a case-insensitive manner.
- public bool tld_domain_is_public_suffix (string domain)
Looks whether the domain
passed as argument is a public
domain suffix (.
- public Quark tld_error_quark ()
- public unowned string tld_get_base_domain (string hostname) throws Error
Finds the base domain for a given hostname
.
- public string uri_decode (string part)
Fully typeof (
unichar2)
-decodes part
.
- public string uri_encode (string part, string? escape_extra)
This typeof (
unichar2)
-encodes the given URI part and returns the escaped version in allocated memory, which
the caller must free when it is done.
- public string uri_normalize (string part, string? unescape_extra)
typeof (
unichar2)
-decodes any "unreserved" characters (or characters in unescape_extra
) in part
,
and typeof (unichar2)
-encodes any non-ASCII characters,
spaces, and non-printing characters in part
.
- public void value_array_append (ValueArray array, Type type, ...)
Appends the provided value of type type
to array
as with append.
- public void value_array_append_vals (ValueArray array, ...)
Appends the provided values into array
as with
append.
- public ValueArray? value_array_from_args (va_list args)
Creates a ValueArray from the provided
arguments, which must consist of pairs of a Type and a value of that type, terminated by
INVALID.
- public bool value_array_get_nth (ValueArray array, uint index_, Type type, ...)
Gets the index_
element of array
and stores
its value into the provided location.
- public void value_array_insert (ValueArray array, uint index_, Type type, ...)
Inserts the provided value of type type
into array
as with insert.
- public ValueArray value_array_new ()
Creates a new ValueArray.
- public ValueArray value_array_new_with_vals (...)
Creates a new ValueArray and copies the
provided values into it.
- public bool value_array_to_args (ValueArray array, va_list args)
Extracts a ValueArray into the provided
arguments, which must consist of pairs of a Type and a value of pointer-to-that-type, terminated by
INVALID.
- public void value_hash_insert (HashTable<string,Value?> hash, string key, Type type, ...)
Inserts the provided value of type type
into hash
.
- public void value_hash_insert_vals (HashTable<string,Value?> hash, ...)
Inserts the given data into hash
.
- public void value_hash_insert_value (HashTable<string,Value?> hash, string key, Value value)
Inserts value
into hash
.
- public bool value_hash_lookup (HashTable<string,Value?> hash, string key, Type type, ...)
Looks up key
in hash
and stores its value
into the provided location.
- public bool value_hash_lookup_vals (HashTable<string,Value?> hash, ...)
Looks up a number of keys in hash
and returns their
values.
- public HashTable<string,Value?> value_hash_new ()
Creates a GenericSet whose keys are strings
and whose values are Value.
- public HashTable<string,Value?> value_hash_new_with_vals (...)
Creates a GenericSet whose keys are strings
and whose values are Value, and initializes it with the provided data.
- public void websocket_client_prepare_handshake (Message msg, string? origin, string[]? protocols)
Adds the necessary headers to msg
to request a WebSocket
handshake.
- public void websocket_client_prepare_handshake_with_extensions (Message msg, string? origin, string[]? protocols, GenericArray<TypeClass>? supported_extensions)
Adds the necessary headers to msg
to request a WebSocket
handshake including supported WebSocket extensions.
- public bool websocket_client_verify_handshake (Message msg) throws Error
Looks at the response status code and headers in msg
and
determines if they contain a valid WebSocket handshake response (given the handshake request in msg
's request headers).
- public bool websocket_client_verify_handshake_with_extensions (Message msg, GenericArray<TypeClass>? supported_extensions, out List<WebsocketExtension> accepted_extensions) throws Error
Looks at the response status code and headers in msg
and
determines if they contain a valid WebSocket handshake response (given the handshake request in msg
's request headers).
- public Quark websocket_error_get_quark ()
- public bool websocket_server_check_handshake (Message msg, string? origin, string[]? protocols) throws Error
Examines the method and request headers in msg
and
determines whether msg
contains a valid handshake request.
- public bool websocket_server_check_handshake_with_extensions (Message msg, string? origin, string[]? protocols, GenericArray<TypeClass>? supported_extensions) throws Error
Examines the method and request headers in msg
and
determines whether msg
contains a valid handshake request.
- public bool websocket_server_process_handshake (Message msg, string? expected_origin, string[]? protocols)
Examines the method and request headers in msg
and
(assuming msg
contains a valid handshake request), fills in the handshake response.
- public bool websocket_server_process_handshake_with_extensions (Message msg, string? expected_origin, string[]? protocols, GenericArray<TypeClass>? supported_extensions, out List<WebsocketExtension> accepted_extensions)
Examines the method and request headers in msg
and
(assuming msg
contains a valid handshake request), fills in the handshake response.