libsoup-3.0
Description:
libsoup is an HTTP client/server library for GNOME. It uses GObjects and the glib main loop, to integrate well with GNOME applications.
- Home: https://wiki.gnome.org/Projects/libsoup
- C-Documentation: https://libsoup.org/
- Devhelp-Package download
Content:
Namespaces:
- Soup
- SessionFeature - Interface for miscellaneous [class@Session] features.
- Auth - The abstract base class for handling authentication.
- AuthBasic - HTTP "Basic" authentication.
- AuthDigest - HTTP "Digest" authentication.
- AuthDomain - Server-side authentication.
- AuthDomainBasic - Server-side "Basic" authentication.
- AuthDomainDigest - Server-side "Digest" authentication.
- AuthManager - HTTP client-side authentication handler.
- AuthNTLM - HTTP-based NTLM authentication.
- AuthNegotiate - HTTP-based GSS-Negotiate authentication, as defined by RFC 4559.
- Cache - File-based cache for HTTP resources.
- ContentDecoder - Handles decoding of HTTP messages.
- ContentSniffer - Sniffs the mime type of messages.
- Cookie - Implements HTTP cookies, as described by RFC 6265.
- CookieJar - Automatic cookie handling for SoupSession.
- CookieJarDB - Database-based Cookie Jar.
- CookieJarText - Text-file-based ("cookies.
- HSTSEnforcer - Automatic HTTP Strict Transport Security enforcing for [class@Session].
- HSTSEnforcerDB - Persistent HTTP Strict Transport Security enforcer.
- HSTSPolicy - HSTSPolicy implements HTTP policies, as described by RFC 6797.
- Logger - Debug logging support
- Message - Represents an HTTP message being sent or received.
- MessageBody - MessageBody represents the request or response body of a [class@Message].
- MessageHeaders - The HTTP message headers associated with a request or response.
- MessageMetrics - Contains metrics collected while loading a [class@Message] either from the network or the disk cache.
- Multipart - Represents a multipart HTTP message body, parsed according to the syntax of RFC 2046.
- MultipartInputStream - Handles streams of multipart messages.
- Server - A HTTP server.
- ServerMessage - An HTTP server request and response pair.
- Session - Soup session state object.
- WebsocketConnection - The WebSocket Protocol
- WebsocketExtension - A WebSocket extension
- WebsocketExtensionDeflate - A SoupWebsocketExtensionDeflate is a [class@WebsocketExtension] implementing permessage-deflate (RFC 7692).
- WebsocketExtensionManager - SoupWebsocketExtensionManager is the [iface@SessionFeature] that handles WebSockets extensions for a [class@Session].
- MessageHeadersIter - An opaque type used to iterate over a soupmessageheaders structure.
- Range - Represents a byte range as used in the Range header.
- CacheType - The type of cache; this affects what kinds of responses will be saved.
- Cacheability - Indicates if a message should or shouldn't be cached.
- CookieJarAcceptPolicy - The policy for accepting or rejecting cookies returned in responses.
- DateFormat - Date formats that [ func@date_time_to_string] can use.
- Encoding - How a message body is encoded for transport
- Expectation - Represents the parsed value of the "Expect" header.
- HTTPVersion - Indicates the HTTP protocol version being used.
- LoggerLogLevel - Describes the level of logging output to provide.
- MemoryUse - The lifetime of the memory being passed.
- MessageFlags - Various flags that can be set on a Message to alter its behavior.
- MessageHeadersType - Value passed to [ ctor@MessageHeaders.
- MessagePriority - Priorities that can be set on a [class@Message] to instruct the message queue to process it before any other message with lower priority.
- SameSitePolicy - Represents the same-site policies of a cookie.
- ServerListenOptions - Options to pass to [method@Server.
- Status - These represent the known HTTP status code values, plus various network and internal errors.
- URIComponent - Enum values passed to [ func@uri_copy] to indicate the components of the URI that should be updated with the given values.
- WebsocketCloseCode - Pre-defined close codes that can be passed to [method@WebsocketConnection.
- WebsocketConnectionType - The type of a [class@WebsocketConnection].
- WebsocketDataType - The type of data
contained in a [signal@WebsocketConnection:
:message
] signal. - WebsocketState - The state of the WebSocket connection.
- SessionError - A Session error.
- TLDError - Error codes for soup_tld_error.
- WebsocketError - WebSocket-related errors.
- public const int COOKIE_MAX_AGE_ONE_DAY
A constant corresponding to 1 day.
- public const int COOKIE_MAX_AGE_ONE_HOUR
A constant corresponding to 1 hour.
- public const int COOKIE_MAX_AGE_ONE_WEEK
A constant corresponding to 1 week.
- public const int COOKIE_MAX_AGE_ONE_YEAR
A constant corresponding to 1 year.
- public const string FORM_MIME_TYPE_MULTIPART
A macro containing the value `multipart/form-data`; the MIME type used for posting form data that contains files to be uploaded.
- public const string FORM_MIME_TYPE_URLENCODED
A macro containing the value `application/x-www-form-urlencoded`; the default MIME type for POSTing HTML form data.
- public const int HSTS_POLICY_MAX_AGE_PAST
An expiration date that is always in the past.
- public const int HTTP_URI_FLAGS
- public const int MAJOR_VERSION
Like [func@get_major_version], but from the headers used at application compile time, rather than from the library linked against at application run time.
- public const int MICRO_VERSION
Like [func@get_micro_version], but from the headers used at application compile time, rather than from the library linked against at application run time.
- public const int MINOR_VERSION
Like [func@get_minor_version], but from the headers used at application compile time, rather than from the library linked against at application run time.
- public const int VERSION_MIN_REQUIRED
A macro that should be defined by the user prior to including `libsoup.
- public delegate bool AuthDomainBasicAuthCallback (AuthDomainBasic domain, ServerMessage msg, string username, string password)
Callback used by AuthDomainBasic for authentication purposes.
- public delegate string? AuthDomainDigestAuthCallback (AuthDomainDigest domain, ServerMessage msg, string username)
Callback used by AuthDomainDigest for authentication purposes.
- public delegate bool AuthDomainFilter (AuthDomain domain, ServerMessage msg)
The prototype for a AuthDomain filter.
- public delegate bool AuthDomainGenericAuthCallback (AuthDomain domain, ServerMessage msg, string username)
The prototype for a AuthDomain generic authentication callback.
- public delegate LoggerLogLevel LoggerFilter (Logger logger, Message msg)
The prototype for a logging filter.
- public delegate void LoggerPrinter (Logger logger, LoggerLogLevel level, char direction, string data)
The prototype for a custom printing callback.
- public delegate void MessageHeadersForeachFunc (string name, string value)
The callback passed to [method@MessageHeaders.
- public delegate void ServerCallback (Server server, ServerMessage msg, string path, HashTable<string,string>? query)
A callback used to handle requests to a [class@Server].
- public delegate void ServerWebsocketCallback (Server server, ServerMessage msg, string path, WebsocketConnection connection)
A callback used to handle WebSocket requests to a Server.
- public bool check_version (uint major, uint minor, uint micro)
Like [func@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 [ struct@GLib. - public SList<Cookie> cookies_from_response (Message msg)
Parses
msg
's Set-Cookie response headers and returns a [ struct@GLib. - public string cookies_to_cookie_header (SList<Cookie> cookies)
Serializes a [struct@GLib.
- public void cookies_to_request (SList<Cookie> cookies, Message msg)
Adds the name and value of each cookie in
cookies
tomsg
's "Cookie" request. - public void cookies_to_response (SList<Cookie> cookies, Message msg)
Appends a "Set-Cookie" response header to
msg
for each cookie incookies
. - public DateTime? date_time_new_from_http_string (string date_string)
Parses
date_string
and tries to extract a date from it. - public string date_time_to_string (DateTime date, DateFormat format)
Converts
date
to a string in the format described byformat
. - 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 bool header_contains (string header, string token)
Parses
header
to see if it contains the tokentoken
(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 quotevalue
if needed, and if so, to escape any quotes or backslashes invalue
. - 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 invalue
. - public SList<string> header_parse_list (string header)
Parses a header whose content is described by RFC2616 as `
something
`. - 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)
A strict version of [func@header_parse_param_list] that bails out if there are duplicate parameters.
- 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)
A strict version of [func@header_parse_semi_param_list] that bails out if there are duplicate parameters.
- 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 indest
. - 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 inreq_method
,req_path
,ver
, andreq_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 inver
,status_code
,reason_phrase
, andheaders
. - 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
intover
,status_code
, andreason_phrase
. - public void message_headers_iter_init (out MessageHeadersIter iter, MessageHeaders hdrs)
- public Quark session_error_quark ()
- public unowned string status_get_phrase (uint status_code)
- 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 Uri uri_copy (Uri uri, ...)
As of 3.4.0 this will detect the default ports of HTTP(s) and WS(S) URIs when copying and set it to the default port of the new scheme.
- public Bytes uri_decode_data_uri (string uri, out string? content_type)
Decodes the given data URI and returns its contents and
content_type
. - public bool uri_equal (Uri uri1, Uri uri2)
Tests whether or not
uri1
anduri2
are equal in all parts. - public void websocket_client_prepare_handshake (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, 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 inmsg
's request headers). - public Quark websocket_error_quark ()
- public bool websocket_server_check_handshake (ServerMessage msg, string? origin, string[]? protocols, GenericArray<TypeClass>? supported_extensions) throws Error
Examines the method and request headers in
msg
and determines whethermsg
contains a valid handshake request. - public bool websocket_server_process_handshake (ServerMessage msg, string? expected_origin, string[]? protocols, GenericArray<TypeClass>? supported_extensions, out List<WebsocketExtension> accepted_extensions)
Examines the method and request headers in
msg
and (assumingmsg
contains a valid handshake request), fills in the handshake response. - Form
- public HashTable<unowned string,unowned string> decode (string encoded_form)
Decodes
form
. - public HashTable<unowned string,unowned string>? decode_multipart (Multipart multipart, string? file_control_name, out string filename, out string content_type, out Bytes file)
Decodes the "multipart/form-data" request in
multipart
. - public string encode (...)
Encodes the given field names and values into a value of type "application/x-www-form-urlencoded".
- public string encode_datalist (Datalist<string> form_data_set)
Encodes
form_data_set
into a value of type "application/x-www-form-urlencoded". - public string encode_hash (HashTable<string,string> form_data_set)
Encodes
form_data_set
into a value of type "application/x-www-form-urlencoded". - public string encode_valist (string first_field, va_list args)
See [func@form_encode].