Gjsify LogoGjsify Logo

Index

Enumerations

Classes

Interfaces

Variables

Functions

Variables

ADDRESS_ANY_PORT: number

This can be passed to any #SoupAddress method that expects a port, to indicate that you don't care what port is used.

ADDRESS_FAMILY: string

Alias for the #SoupAddress:family property. (The #SoupAddressFamily for this address.)

ADDRESS_NAME: string

Alias for the #SoupAddress:name property. (The hostname for this address.)

ADDRESS_PHYSICAL: string

An alias for the #SoupAddress:physical property. (The stringified IP address for this address.)

ADDRESS_PORT: string

An alias for the #SoupAddress:port property. (The port for this address.)

ADDRESS_PROTOCOL: string

Alias for the #SoupAddress:protocol property. (The URI scheme used with this address.)

ADDRESS_SOCKADDR: string

An alias for the #SoupAddress:sockaddr property. (A pointer to the struct sockaddr for this address.)

AUTH_DOMAIN_ADD_PATH: string

Alias for the #SoupAuthDomain:add-path property. (Shortcut for calling soup_auth_domain_add_path().)

AUTH_DOMAIN_BASIC_AUTH_CALLBACK: string

Alias for the #SoupAuthDomainBasic:auth-callback property. (The #SoupAuthDomainBasicAuthCallback.)

AUTH_DOMAIN_BASIC_AUTH_DATA: string

Alias for the #SoupAuthDomainBasic:auth-data property. (The data to pass to the #SoupAuthDomainBasicAuthCallback.)

AUTH_DOMAIN_DIGEST_AUTH_CALLBACK: string

Alias for the #SoupAuthDomainDigest:auth-callback property. (The #SoupAuthDomainDigestAuthCallback.)

AUTH_DOMAIN_DIGEST_AUTH_DATA: string

Alias for the #SoupAuthDomainDigest:auth-callback property. (The #SoupAuthDomainDigestAuthCallback.)

AUTH_DOMAIN_FILTER: string

Alias for the #SoupAuthDomain:filter property. (The #SoupAuthDomainFilter for the domain.)

AUTH_DOMAIN_FILTER_DATA: string

Alias for the #SoupAuthDomain:filter-data property. (Data to pass to the #SoupAuthDomainFilter.)

AUTH_DOMAIN_GENERIC_AUTH_CALLBACK: string

Alias for the #SoupAuthDomain:generic-auth-callback property. (The #SoupAuthDomainGenericAuthCallback.)

AUTH_DOMAIN_GENERIC_AUTH_DATA: string

Alias for the #SoupAuthDomain:generic-auth-data property. (The data to pass to the #SoupAuthDomainGenericAuthCallback.)

AUTH_DOMAIN_PROXY: string

Alias for the #SoupAuthDomain:proxy property. (Whether or not this is a proxy auth domain.)

AUTH_DOMAIN_REALM: string

Alias for the #SoupAuthDomain:realm property. (The realm of this auth domain.)

AUTH_DOMAIN_REMOVE_PATH: string

Alias for the #SoupAuthDomain:remove-path property. (Shortcut for calling soup_auth_domain_remove_path().)

AUTH_HOST: string

An alias for the #SoupAuth:host property. (The host being authenticated to.)

AUTH_IS_AUTHENTICATED: string

An alias for the #SoupAuth:is-authenticated property. (Whether or not the auth has been authenticated.)

AUTH_IS_FOR_PROXY: string

An alias for the #SoupAuth:is-for-proxy property. (Whether or not the auth is for a proxy server.)

AUTH_REALM: string

An alias for the #SoupAuth:realm property. (The authentication realm.)

AUTH_SCHEME_NAME: string

An alias for the #SoupAuth:scheme-name property. (The authentication scheme name.)

CHAR_HTTP_CTL: number
CHAR_HTTP_SEPARATOR: number
CHAR_URI_GEN_DELIMS: number
CHAR_URI_PERCENT_ENCODED: number
CHAR_URI_SUB_DELIMS: number
COOKIE_JAR_ACCEPT_POLICY: string

Alias for the #SoupCookieJar:accept-policy property.

COOKIE_JAR_DB_FILENAME: string

Alias for the #SoupCookieJarDB:filename property. (The cookie-storage filename.)

COOKIE_JAR_READ_ONLY: string

Alias for the #SoupCookieJar:read-only property. (Whether or not the cookie jar is read-only.)

COOKIE_JAR_TEXT_FILENAME: string

Alias for the #SoupCookieJarText:filename property. (The cookie-storage filename.)

COOKIE_MAX_AGE_ONE_DAY: number

A constant corresponding to 1 day, for use with soup_cookie_new() and soup_cookie_set_max_age().

COOKIE_MAX_AGE_ONE_HOUR: number

A constant corresponding to 1 hour, for use with soup_cookie_new() and soup_cookie_set_max_age().

COOKIE_MAX_AGE_ONE_WEEK: number

A constant corresponding to 1 week, for use with soup_cookie_new() and soup_cookie_set_max_age().

COOKIE_MAX_AGE_ONE_YEAR: number

A constant corresponding to 1 year, for use with soup_cookie_new() and soup_cookie_set_max_age().

FORM_MIME_TYPE_MULTIPART: string

A macro containing the value "multipart/form-data"; the MIME type used for posting form data that contains files to be uploaded.

FORM_MIME_TYPE_URLENCODED: string

A macro containing the value "application/x-www-form-urlencoded"; the default MIME type for POSTing HTML form data.

HSTS_ENFORCER_DB_FILENAME: string
HSTS_POLICY_MAX_AGE_PAST: number
LOGGER_LEVEL: string

Alias for the #SoupLogger:level property, qv.

LOGGER_MAX_BODY_SIZE: string

Alias for the #SoupLogger:max-body-size property, qv.

MAJOR_VERSION: number

Like soup_get_major_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.

MESSAGE_FIRST_PARTY: string

Alias for the #SoupMessage:first-party property. (The #SoupURI loaded in the application when the message was queued.)

MESSAGE_FLAGS: string

Alias for the #SoupMessage:flags property. (The message's #SoupMessageFlags.)

MESSAGE_HTTP_VERSION: string

Alias for the #SoupMessage:http-version property. (The message's #SoupHTTPVersion.)

MESSAGE_IS_TOP_LEVEL_NAVIGATION: string
MESSAGE_METHOD: string

Alias for the #SoupMessage:method property. (The message's HTTP method.)

MESSAGE_PRIORITY: string

Sets the priority of the #SoupMessage. See soup_message_set_priority() for further details.

MESSAGE_REASON_PHRASE: string

Alias for the #SoupMessage:reason-phrase property. (The message's HTTP response reason phrase.)

MESSAGE_REQUEST_BODY: string

Alias for the #SoupMessage:request-body property. (The message's HTTP request body.)

MESSAGE_REQUEST_BODY_DATA: string

Alias for the #SoupMessage:request-body-data property. (The message's HTTP request body, as a #GBytes.)

MESSAGE_REQUEST_HEADERS: string

Alias for the #SoupMessage:request-headers property. (The message's HTTP request headers.)

MESSAGE_RESPONSE_BODY: string

Alias for the #SoupMessage:response-body property. (The message's HTTP response body.)

MESSAGE_RESPONSE_BODY_DATA: string

Alias for the #SoupMessage:response-body-data property. (The message's HTTP response body, as a #GBytes.)

MESSAGE_RESPONSE_HEADERS: string

Alias for the #SoupMessage:response-headers property. (The message's HTTP response headers.)

MESSAGE_SERVER_SIDE: string

Alias for the #SoupMessage:server-side property. (%TRUE if the message was created by #SoupServer.)

MESSAGE_SITE_FOR_COOKIES: string
MESSAGE_STATUS_CODE: string

Alias for the #SoupMessage:status-code property. (The message's HTTP response status code.)

MESSAGE_TLS_CERTIFICATE: string

Alias for the #SoupMessage:tls-certificate property. (The TLS certificate associated with the message, if any.)

MESSAGE_TLS_ERRORS: string

Alias for the #SoupMessage:tls-errors property. (The verification errors on #SoupMessage:tls-certificate.)

MESSAGE_URI: string

Alias for the #SoupMessage:uri property. (The message's #SoupURI.)

MICRO_VERSION: number

Like soup_get_micro_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.

MINOR_VERSION: number

Like soup_get_minor_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.

REQUEST_SESSION: string

Alias for the #SoupRequest:session property, qv.

REQUEST_URI: string

Alias for the #SoupRequest:uri property, qv.

SERVER_ASYNC_CONTEXT: string

Alias for the deprecated #SoupServer:async-context property, qv.

SERVER_HTTPS_ALIASES: string

Alias for the #SoupServer:https-aliases property, qv.

SERVER_HTTP_ALIASES: string

Alias for the #SoupServer:http-aliases property, qv.

SERVER_INTERFACE: string

Alias for the #SoupServer:interface property, qv.

SERVER_PORT: string

Alias for the deprecated #SoupServer:port property, qv.

SERVER_RAW_PATHS: string

Alias for the #SoupServer:raw-paths property. (If %TRUE, percent-encoding in the Request-URI path will not be automatically decoded.)

SERVER_SERVER_HEADER: string

Alias for the #SoupServer:server-header property, qv.

SERVER_SSL_CERT_FILE: string

Alias for the #SoupServer:ssl-cert-file property, qv.

SERVER_SSL_KEY_FILE: string

Alias for the #SoupServer:ssl-key-file property, qv.

SERVER_TLS_CERTIFICATE: string

Alias for the #SoupServer:tls-certificate property, qv.

SESSION_ACCEPT_LANGUAGE: string

Alias for the #SoupSession:accept-language property, qv.

SESSION_ACCEPT_LANGUAGE_AUTO: string

Alias for the #SoupSession:accept-language-auto property, qv.

SESSION_ASYNC_CONTEXT: string

Alias for the #SoupSession:async-context property, qv.

SESSION_HTTPS_ALIASES: string

Alias for the #SoupSession:https-aliases property, qv.

SESSION_HTTP_ALIASES: string

Alias for the #SoupSession:http-aliases property, qv.

SESSION_IDLE_TIMEOUT: string

Alias for the #SoupSession:idle-timeout property, qv.

SESSION_LOCAL_ADDRESS: string

Alias for the #SoupSession:local-address property, qv.

SESSION_MAX_CONNS: string

Alias for the #SoupSession:max-conns property, qv.

SESSION_MAX_CONNS_PER_HOST: string

Alias for the #SoupSession:max-conns-per-host property, qv.

SESSION_PROXY_RESOLVER: string

Alias for the #SoupSession:proxy-resolver property, qv.

SESSION_PROXY_URI: string

Alias for the #SoupSession:proxy-uri property, qv.

SESSION_SSL_CA_FILE: string

Alias for the #SoupSession:ssl-ca-file property, qv.

SESSION_SSL_STRICT: string

Alias for the #SoupSession:ssl-strict property, qv.

SESSION_SSL_USE_SYSTEM_CA_FILE: string

Alias for the #SoupSession:ssl-use-system-ca-file property, qv.

SESSION_TIMEOUT: string

Alias for the #SoupSession:timeout property, qv.

SESSION_TLS_DATABASE: string

Alias for the #SoupSession:tls-database property, qv.

SESSION_TLS_INTERACTION: string

Alias for the #SoupSession:tls-interaction property, qv.

SESSION_USER_AGENT: string

Alias for the #SoupSession:user-agent property, qv.

SESSION_USE_NTLM: string

Alias for the #SoupSession:use-ntlm property, qv.

SESSION_USE_THREAD_CONTEXT: string

Alias for the #SoupSession:use-thread-context property, qv.

SOCKET_ASYNC_CONTEXT: string

Alias for the #SoupSocket:async-context property. (The socket's #GMainContext.)

SOCKET_FLAG_NONBLOCKING: string

Alias for the #SoupSocket:non-blocking property. (Whether or not the socket uses non-blocking I/O.)

SOCKET_IS_SERVER: string

Alias for the #SoupSocket:is-server property, qv.

SOCKET_LOCAL_ADDRESS: string

Alias for the #SoupSocket:local-address property. (Address of local end of socket.)

SOCKET_REMOTE_ADDRESS: string

Alias for the #SoupSocket:remote-address property. (Address of remote end of socket.)

SOCKET_SSL_CREDENTIALS: string

Alias for the #SoupSocket:ssl-creds property. (SSL credential information.)

SOCKET_SSL_FALLBACK: string

Alias for the #SoupSocket:ssl-fallback property.

SOCKET_SSL_STRICT: string

Alias for the #SoupSocket:ssl-strict property.

SOCKET_TIMEOUT: string

Alias for the #SoupSocket:timeout property. (The timeout in seconds for blocking socket I/O operations.)

SOCKET_TLS_CERTIFICATE: string

Alias for the #SoupSocket:tls-certificate property. Note that this property's value is only useful if the socket is for a TLS connection, and only reliable after some data has been transferred to or from it.

SOCKET_TLS_ERRORS: string

Alias for the #SoupSocket:tls-errors property. Note that this property's value is only useful if the socket is for a TLS connection, and only reliable after some data has been transferred to or from it.

SOCKET_TRUSTED_CERTIFICATE: string

Alias for the #SoupSocket:trusted-certificate property.

SOCKET_USE_THREAD_CONTEXT: string

Alias for the #SoupSocket:use-thread-context property. (Use g_main_context_get_thread_default())

VERSION_MIN_REQUIRED: number

A macro that should be defined by the user prior to including libsoup.h. The definition should be one of the predefined libsoup version macros: %SOUP_VERSION_2_24, %SOUP_VERSION_2_26, ...

This macro defines the earliest version of libsoup that the package is required to be able to compile against.

If the compiler is configured to warn about the use of deprecated functions, then using functions that were deprecated in version %SOUP_VERSION_MIN_REQUIRED or earlier will cause warnings (but using functions deprecated in later releases will not).

Functions

  • check_version(major: number, minor: number, micro: number): boolean
  • Like SOUP_CHECK_VERSION, but the check for soup_check_version is at runtime instead of compile time. This is useful for compiling against older versions of libsoup, but using features from newer versions.

    Parameters

    • major: number

      the major version to check

    • minor: number

      the minor version to check

    • micro: number

      the micro version to check

    Returns boolean

  • Parses header and returns a #SoupCookie. (If header contains multiple cookies, only the first one will be parsed.)

    If header does not have "path" or "domain" attributes, they will be defaulted from origin. If origin is %NULL, path will default to "/", but domain will be left as %NULL. Note that this is not a valid state for a #SoupCookie, and you will need to fill in some appropriate string for the domain if you want to actually make use of the cookie.

    Parameters

    • header: string

      a cookie string (eg, the value of a Set-Cookie header)

    • origin: Soup.URI

      origin of the cookie, or %NULL

    Returns Soup.Cookie | null

  • Parses msg's Cookie request header and returns a #GSList of #SoupCookies. As the "Cookie" header, unlike "Set-Cookie", only contains cookie names and values, none of the other #SoupCookie fields will be filled in. (Thus, you can't generally pass a cookie returned from this method directly to soup_cookies_to_response().)

    Parameters

    • msg: Soup.Message

      a #SoupMessage containing a "Cookie" request header

    Returns Soup.Cookie[]

  • Parses msg's Set-Cookie response headers and returns a #GSList of #SoupCookies. Cookies that do not specify "path" or "domain" attributes will have their values defaulted from msg.

    Parameters

    • msg: Soup.Message

      a #SoupMessage containing a "Set-Cookie" response header

    Returns Soup.Cookie[]

  • cookies_to_cookie_header(cookies: Soup.Cookie[]): string
  • Serializes a #GSList of #SoupCookie into a string suitable for setting as the value of the "Cookie" header.

    Parameters

    Returns string

  • Adds the name and value of each cookie in cookies to msg's "Cookie" request. (If msg already has a "Cookie" request header, these cookies will be appended to the cookies already present. Be careful that you do not append the same cookies twice, eg, when requeuing a message.)

    Parameters

    Returns void

  • Appends a "Set-Cookie" response header to msg for each cookie in cookies. (This is in addition to any other "Set-Cookie" headers msg may already have.)

    Parameters

    Returns void

  • Decodes form, which is an urlencoded dataset as defined in the HTML 4.01 spec.

    Parameters

    • encoded_form: string

      data of type "application/x-www-form-urlencoded"

    Returns HashTable

  • Decodes the "multipart/form-data" request in msg; this is a convenience method for the case when you have a single file upload control in a form. (Or when you don't have any file upload controls, but are still using "multipart/form-data" anyway.) Pass the name of the file upload control in file_control_name, and soup_form_decode_multipart() will extract the uploaded file data into filename, content_type, and file. All of the other form control data will be returned (as strings, as with soup_form_decode()) in the returned #GHashTable.

    You may pass %NULL for filename, content_type and/or file if you do not care about those fields. soup_form_decode_multipart() may also return %NULL in those fields if the client did not provide that information. You must free the returned filename and content-type with g_free(), and the returned file data with soup_buffer_free().

    If you have a form with more than one file upload control, you will need to decode it manually, using soup_multipart_new_from_message() and soup_multipart_get_part().

    Parameters

    • msg: Soup.Message

      a #SoupMessage containing a "multipart/form-data" request body

    • file_control_name: string

      the name of the HTML file upload control, or %NULL

    Returns [HashTable | null, string, string, Soup.Buffer]

  • form_encode_datalist(form_data_set: GLib.Data): string
  • Encodes form_data_set into a value of type "application/x-www-form-urlencoded", as defined in the HTML 4.01 spec. Unlike soup_form_encode_hash(), this preserves the ordering of the form elements, which may be required in some situations.

    Parameters

    • form_data_set: GLib.Data

      a datalist containing name/value pairs

    Returns string

  • form_encode_hash(form_data_set: HashTable<string | number | symbol, string | number | boolean>): string
  • Encodes form_data_set into a value of type "application/x-www-form-urlencoded", as defined in the HTML 4.01 spec.

    Note that the HTML spec states that "The control names/values are listed in the order they appear in the document." Since this method takes a hash table, it cannot enforce that; if you care about the ordering of the form fields, use soup_form_encode_datalist().

    Parameters

    • form_data_set: HashTable<string | number | symbol, string | number | boolean>

      a hash table containing name/value pairs (as strings)

    Returns string

  • form_request_new_from_datalist(method: string, uri: string, form_data_set: GLib.Data): Soup.Message
  • Creates a new %SoupMessage and sets it up to send form_data_set to uri via method, as with soup_form_request_new().

    Parameters

    • method: string

      the HTTP method, either "GET" or "POST"

    • uri: string

      the URI to send the form data to

    • form_data_set: GLib.Data

      the data to send to uri

    Returns Soup.Message

  • form_request_new_from_hash(method: string, uri: string, form_data_set: HashTable<string | number | symbol, string | number | boolean>): Soup.Message
  • Creates a new %SoupMessage and sets it up to send form_data_set to uri via method, as with soup_form_request_new().

    Parameters

    • method: string

      the HTTP method, either "GET" or "POST"

    • uri: string

      the URI to send the form data to

    • form_data_set: HashTable<string | number | symbol, string | number | boolean>

      the data to send to uri

    Returns Soup.Message

  • Creates a new %SoupMessage and sets it up to send multipart to uri via POST.

    To send a "multipart/form-data" POST, first create a #SoupMultipart, using %SOUP_FORM_MIME_TYPE_MULTIPART as the MIME type. Then use soup_multipart_append_form_string() and soup_multipart_append_form_file() to add the value of each form control to the multipart. (These are just convenience methods, and you can use soup_multipart_append_part() if you need greater control over the part headers.) Finally, call soup_form_request_new_from_multipart() to serialize the multipart structure and create a #SoupMessage.

    Parameters

    • uri: string

      the URI to send the form data to

    • multipart: Soup.Multipart

      a "multipart/form-data" #SoupMultipart

    Returns Soup.Message

  • get_major_version(): number
  • Returns the major version number of the libsoup library. (e.g. in libsoup version 2.42.0 this is 2.)

    This function is in the library, so it represents the libsoup library your code is running against. Contrast with the #SOUP_MAJOR_VERSION macro, which represents the major version of the libsoup headers you have included when compiling your code.

    Returns number

  • get_micro_version(): number
  • Returns the micro version number of the libsoup library. (e.g. in libsoup version 2.42.0 this is 0.)

    This function is in the library, so it represents the libsoup library your code is running against. Contrast with the #SOUP_MICRO_VERSION macro, which represents the micro version of the libsoup headers you have included when compiling your code.

    Returns number

  • get_minor_version(): number
  • Returns the minor version number of the libsoup library. (e.g. in libsoup version 2.42.0 this is 42.)

    This function is in the library, so it represents the libsoup library your code is running against. Contrast with the #SOUP_MINOR_VERSION macro, which represents the minor version of the libsoup headers you have included when compiling your code.

    Returns number

  • header_contains(header: string, token: string): boolean
  • Parses header to see if it contains the token token (matched case-insensitively). Note that this can't be used with lists that have qvalues.

    Parameters

    • header: string

      An HTTP header suitable for parsing with soup_header_parse_list()

    • token: string

      a token

    Returns boolean

  • header_free_param_list(param_list: HashTable<string | number | symbol, string | number | boolean>): void
  • Frees param_list.

    Parameters

    • param_list: HashTable<string | number | symbol, string | number | boolean>

      a #GHashTable returned from soup_header_parse_param_list() or soup_header_parse_semi_param_list()

    Returns void

  • header_g_string_append_param(string: GLib.String, name: string, value: string): void
  • Appends something like name=``value</literal> to string, taking care to quote value if needed, and if so, to escape any quotes or backslashes in value.

    Alternatively, if value is a non-ASCII UTF-8 string, it will be appended using RFC5987 syntax. Although in theory this is supposed to work anywhere in HTTP that uses this style of parameter, in reality, it can only be used portably with the Content-Disposition "filename" parameter.

    If value is %NULL, this will just append name to string.

    Parameters

    • string: GLib.String

      a #GString being used to construct an HTTP header value

    • name: string

      a parameter name

    • value: string

      a parameter value, or %NULL

    Returns void

  • header_g_string_append_param_quoted(string: GLib.String, name: string, value: string): void
  • Appends something like name="value" to string, taking care to escape any quotes or backslashes in value.

    If value is (non-ASCII) UTF-8, this will instead use RFC 5987 encoding, just like soup_header_g_string_append_param().

    Parameters

    • string: GLib.String

      a #GString being used to construct an HTTP header value

    • name: string

      a parameter name

    • value: string

      a parameter value

    Returns void

  • header_parse_list(header: string): string[]
  • Parses a header whose content is described by RFC2616 as "#something", where "something" does not itself contain commas, except as part of quoted-strings.

    Parameters

    • header: string

      a header value

    Returns string[]

  • header_parse_param_list(header: string): HashTable
  • Parses a header which is a comma-delimited list of something like: token [ "=" ( token | quoted-string ) ].

    Tokens that don't have an associated value will still be added to the resulting hash table, but with a %NULL value.

    This also handles RFC5987 encoding (which in HTTP is mostly used for giving UTF8-encoded filenames in the Content-Disposition header).

    Parameters

    • header: string

      a header value

    Returns HashTable

  • header_parse_param_list_strict(header: string): HashTable | null
  • A strict version of soup_header_parse_param_list() that bails out if there are duplicate parameters. Note that this function will treat RFC5987-encoded parameters as duplicated if an ASCII version is also present. For header fields that might contain RFC5987-encoded parameters, use soup_header_parse_param_list() instead.

    Parameters

    • header: string

      a header value

    Returns HashTable | null

  • header_parse_quality_list(header: string): [string[], string[]]
  • Parses a header whose content is a list of items with optional "qvalue"s (eg, Accept, Accept-Charset, Accept-Encoding, Accept-Language, TE).

    If unacceptable is not %NULL, then on return, it will contain the items with qvalue 0. Either way, those items will be removed from the main list.

    Parameters

    • header: string

      a header value

    Returns [string[], string[]]

  • header_parse_semi_param_list(header: string): HashTable
  • Parses a header which is a semicolon-delimited list of something like: token [ "=" ( token | quoted-string ) ].

    Tokens that don't have an associated value will still be added to the resulting hash table, but with a %NULL value.

    This also handles RFC5987 encoding (which in HTTP is mostly used for giving UTF8-encoded filenames in the Content-Disposition header).

    Parameters

    • header: string

      a header value

    Returns HashTable

  • header_parse_semi_param_list_strict(header: string): HashTable | null
  • A strict version of soup_header_parse_semi_param_list() that bails out if there are duplicate parameters. Note that this function will treat RFC5987-encoded parameters as duplicated if an ASCII version is also present. For header fields that might contain RFC5987-encoded parameters, use soup_header_parse_semi_param_list() instead.

    Parameters

    • header: string

      a header value

    Returns HashTable | null

  • Parses the headers of an HTTP request or response in str and stores the results in dest. Beware that dest may be modified even on failure.

    This is a low-level method; normally you would use soup_headers_parse_request() or soup_headers_parse_response().

    Parameters

    • str: string

      the header string (including the Request-Line or Status-Line, but not the trailing blank line)

    • len: number

      length of str

    • dest: Soup.MessageHeaders

      #SoupMessageHeaders to store the header values in

    Returns boolean

  • Parses the headers of an HTTP request in str and stores the results in req_method, req_path, ver, and req_headers.

    Beware that req_headers may be modified even on failure.

    Parameters

    • str: string

      the headers (up to, but not including, the trailing blank line)

    • len: number

      length of str

    • req_headers: Soup.MessageHeaders

      #SoupMessageHeaders to store the header values in

    Returns [number, string, string, Soup.HTTPVersion]

  • Parses the headers of an HTTP response in str and stores the results in ver, status_code, reason_phrase, and headers.

    Beware that headers may be modified even on failure.

    Parameters

    • str: string

      the headers (up to, but not including, the trailing blank line)

    • len: number

      length of str

    • headers: Soup.MessageHeaders

      #SoupMessageHeaders to store the header values in

    Returns [boolean, Soup.HTTPVersion, number, string]

  • headers_parse_status_line(status_line: string): [boolean, Soup.HTTPVersion, number, string]
  • Parses the HTTP Status-Line string in status_line into ver, status_code, and reason_phrase. status_line must be terminated by either "\0" or "\r\n".

    Parameters

    • status_line: string

      an HTTP Status-Line

    Returns [boolean, Soup.HTTPVersion, number, string]

  • http_error_quark(): Quark
  • request_error_quark(): Quark
  • requester_error_quark(): Quark
  • status_get_phrase(status_code: number): string
  • Looks up the stock HTTP description of status_code. This is used by soup_message_set_status() to get the correct text to go with a given status code.

    There is no reason for you to ever use this function. If you wanted the textual description for the #SoupMessage:status_code of a given #SoupMessage, you should just look at the message's #SoupMessage:reason_phrase. However, you should only do that for use in debugging messages; HTTP reason phrases are not localized, and are not generally very descriptive anyway, and so they should never be presented to the user directly. Instead, you should create you own error messages based on the status code, and on what you were trying to do.

    Parameters

    • status_code: number

      an HTTP status code

    Returns string

  • status_proxify(status_code: number): number
  • Turns %SOUP_STATUS_CANT_RESOLVE into %SOUP_STATUS_CANT_RESOLVE_PROXY and %SOUP_STATUS_CANT_CONNECT into %SOUP_STATUS_CANT_CONNECT_PROXY. Other status codes are passed through unchanged.

    Parameters

    • status_code: number

      a status code

    Returns number

  • str_case_equal(v1: object, v2: object): boolean
  • Compares v1 and v2 in a case-insensitive manner

    Parameters

    • v1: object

      an ASCII string

    • v2: object

      another ASCII string

    Returns boolean

  • str_case_hash(key: object): number
  • tld_domain_is_public_suffix(domain: string): boolean
  • Looks whether the domain passed as argument is a public domain suffix (.org, .com, .co.uk, etc) or not.

    Prior to libsoup 2.46, this function required that domain be in UTF-8 if it was an IDN. From 2.46 on, the name can be in either UTF-8 or ASCII format.

    Parameters

    • domain: string

      a domain name

    Returns boolean

  • tld_get_base_domain(hostname: string): string
  • Finds the base domain for a given hostname. The base domain is composed by the top level domain (such as .org, .com, .co.uk, etc) plus the second level domain, for example for myhost.mydomain.com it will return mydomain.com.

    Note that %NULL will be returned for private URLs (those not ending with any well known TLD) because choosing a base domain for them would be totally arbitrary.

    Prior to libsoup 2.46, this function required that hostname be in UTF-8 if it was an IDN. From 2.46 on, the name can be in either UTF-8 or ASCII format (and the return value will be in the same format).

    Parameters

    • hostname: string

      a hostname

    Returns string

  • uri_decode(part: string): string
  • Fully %-decodes part.

    In the past, this would return %NULL if part contained invalid percent-encoding, but now it just ignores the problem (as soup_uri_new() already did).

    Parameters

    • part: string

      a URI part

    Returns string

  • uri_encode(part: string, escape_extra: string): string
  • This %-encodes the given URI part and returns the escaped version in allocated memory, which the caller must free when it is done.

    Parameters

    • part: string

      a URI part

    • escape_extra: string

      additional reserved characters to escape (or %NULL)

    Returns string

  • uri_normalize(part: string, unescape_extra: string): string
  • %-decodes any "unreserved" characters (or characters in unescape_extra) in part, and %-encodes any non-ASCII characters, spaces, and non-printing characters in part.

    "Unreserved" characters are those that are not allowed to be used for punctuation according to the URI spec. For example, letters are unreserved, so soup_uri_normalize() will turn http://example.com/foo/b%61r into http://example.com/foo/bar, which is guaranteed to mean the same thing. However, "/" is "reserved", so http://example.com/foo%2Fbar would not be changed, because it might mean something different to the server.

    In the past, this would return %NULL if part contained invalid percent-encoding, but now it just ignores the problem (as soup_uri_new() already did).

    Parameters

    • part: string

      a URI part

    • unescape_extra: string

      reserved characters to unescape (or %NULL)

    Returns string

  • value_hash_insert_value(hash: HashTable<string | number | symbol, string | number | boolean>, key: string, value: any): void
  • Inserts value into hash. (Unlike with g_hash_table_insert(), both the key and the value are copied).

    Parameters

    • hash: HashTable<string | number | symbol, string | number | boolean>

      a value hash

    • key: string

      the key

    • value: any

      a value

    Returns void

  • websocket_client_prepare_handshake(msg: Soup.Message, origin: string, protocols: string[]): void
  • Adds the necessary headers to msg to request a WebSocket handshake. The message body and non-WebSocket-related headers are not modified.

    Use soup_websocket_client_prepare_handshake_with_extensions() if you want to include "Sec-WebSocket-Extensions" header in the request.

    This is a low-level function; if you use soup_session_websocket_connect_async() to create a WebSocket connection, it will call this for you.

    Parameters

    • msg: Soup.Message

      a #SoupMessage

    • origin: string

      the "Origin" header to set

    • protocols: string[]

      list of protocols to offer

    Returns void

  • websocket_client_prepare_handshake_with_extensions(msg: Soup.Message, origin: string, protocols: string[], supported_extensions: GObject.TypeClass[]): void
  • Adds the necessary headers to msg to request a WebSocket handshake including supported WebSocket extensions. The message body and non-WebSocket-related headers are not modified.

    This is a low-level function; if you use soup_session_websocket_connect_async() to create a WebSocket connection, it will call this for you.

    Parameters

    • msg: Soup.Message

      a #SoupMessage

    • origin: string

      the "Origin" header to set

    • protocols: string[]

      list of protocols to offer

    • supported_extensions: GObject.TypeClass[]

      list of supported extension types

    Returns void

  • websocket_client_verify_handshake(msg: Soup.Message): boolean
  • 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).

    If the response contains the "Sec-WebSocket-Extensions" header, the handshake will be considered invalid. You need to use soup_websocket_client_verify_handshake_with_extensions() to handle responses with extensions.

    This is a low-level function; if you use soup_session_websocket_connect_async() to create a WebSocket connection, it will call this for you.

    Parameters

    • msg: Soup.Message

      #SoupMessage containing both client and server sides of a WebSocket handshake

    Returns boolean

  • 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).

    If supported_extensions is non-%NULL, extensions included in the response "Sec-WebSocket-Extensions" are verified too. Accepted extensions are returned in accepted_extensions parameter if non-%NULL.

    This is a low-level function; if you use soup_session_websocket_connect_async() to create a WebSocket connection, it will call this for you.

    Parameters

    • msg: Soup.Message

      #SoupMessage containing both client and server sides of a WebSocket handshake

    • supported_extensions: GObject.TypeClass[]

      list of supported extension types

    Returns [boolean, Soup.WebsocketExtension[]]

  • websocket_error_get_quark(): Quark
  • websocket_server_check_handshake(msg: Soup.Message, origin: string, protocols: string[]): boolean
  • Examines the method and request headers in msg and determines whether msg contains a valid handshake request.

    If origin is non-%NULL, then only requests containing a matching "Origin" header will be accepted. If protocols is non-%NULL, then only requests containing a compatible "Sec-WebSocket-Protocols" header will be accepted.

    Requests containing "Sec-WebSocket-Extensions" header will be accepted even if the header is not valid. To check a request with extensions you need to use soup_websocket_server_check_handshake_with_extensions() and provide the list of supported extension types.

    Normally soup_websocket_server_process_handshake() will take care of this for you, and if you use soup_server_add_websocket_handler() to handle accepting WebSocket connections, it will call that for you. However, this function may be useful if you need to perform more complicated validation; eg, accepting multiple different Origins, or handling different protocols depending on the path.

    Parameters

    • msg: Soup.Message

      #SoupMessage containing the client side of a WebSocket handshake

    • origin: string

      expected Origin header

    • protocols: string[]

      allowed WebSocket protocols.

    Returns boolean

  • websocket_server_check_handshake_with_extensions(msg: Soup.Message, origin: string, protocols: string[], supported_extensions: GObject.TypeClass[]): boolean
  • Examines the method and request headers in msg and determines whether msg contains a valid handshake request.

    If origin is non-%NULL, then only requests containing a matching "Origin" header will be accepted. If protocols is non-%NULL, then only requests containing a compatible "Sec-WebSocket-Protocols" header will be accepted. If supported_extensions is non-%NULL, then only requests containing valid supported extensions in "Sec-WebSocket-Extensions" header will be accepted.

    Normally soup_websocket_server_process_handshake_with_extensioins() will take care of this for you, and if you use soup_server_add_websocket_handler() to handle accepting WebSocket connections, it will call that for you. However, this function may be useful if you need to perform more complicated validation; eg, accepting multiple different Origins, or handling different protocols depending on the path.

    Parameters

    • msg: Soup.Message

      #SoupMessage containing the client side of a WebSocket handshake

    • origin: string

      expected Origin header

    • protocols: string[]

      allowed WebSocket protocols.

    • supported_extensions: GObject.TypeClass[]

      list of supported extension types

    Returns boolean

  • websocket_server_process_handshake(msg: Soup.Message, expected_origin: string, protocols: string[]): boolean
  • Examines the method and request headers in msg and (assuming msg contains a valid handshake request), fills in the handshake response.

    If expected_origin is non-%NULL, then only requests containing a matching "Origin" header will be accepted. If protocols is non-%NULL, then only requests containing a compatible "Sec-WebSocket-Protocols" header will be accepted.

    Requests containing "Sec-WebSocket-Extensions" header will be accepted even if the header is not valid. To process a request with extensions you need to use soup_websocket_server_process_handshake_with_extensions() and provide the list of supported extension types.

    This is a low-level function; if you use soup_server_add_websocket_handler() to handle accepting WebSocket connections, it will call this for you.

    Parameters

    • msg: Soup.Message

      #SoupMessage containing the client side of a WebSocket handshake

    • expected_origin: string

      expected Origin header

    • protocols: string[]

      allowed WebSocket protocols.

    Returns boolean

  • Examines the method and request headers in msg and (assuming msg contains a valid handshake request), fills in the handshake response.

    If expected_origin is non-%NULL, then only requests containing a matching "Origin" header will be accepted. If protocols is non-%NULL, then only requests containing a compatible "Sec-WebSocket-Protocols" header will be accepted. If supported_extensions is non-%NULL, then only requests containing valid supported extensions in "Sec-WebSocket-Extensions" header will be accepted. The accepted extensions will be returned in accepted_extensions parameter if non-%NULL.

    This is a low-level function; if you use soup_server_add_websocket_handler() to handle accepting WebSocket connections, it will call this for you.

    Parameters

    • msg: Soup.Message

      #SoupMessage containing the client side of a WebSocket handshake

    • expected_origin: string

      expected Origin header

    • protocols: string[]

      allowed WebSocket protocols.

    • supported_extensions: GObject.TypeClass[]

      list of supported extension types

    Returns [boolean, Soup.WebsocketExtension[]]

  • xmlrpc_build_method_call(method_name: string, params: any[]): string | null
  • This creates an XML-RPC methodCall and returns it as a string. This is the low-level method that soup_xmlrpc_request_new() is built on.

    params is an array of #GValue representing the parameters to method. (It is not a #GValueArray, although if you have a #GValueArray, you can just pass its valuesf and n_values fields.)

    The correspondence between glib types and XML-RPC types is:

    int: #int (%G_TYPE_INT) boolean: #gboolean (%G_TYPE_BOOLEAN) string: #char* (%G_TYPE_STRING) double: #double (%G_TYPE_DOUBLE) datetime.iso8601: #SoupDate (%SOUP_TYPE_DATE) base64: #GByteArray (%SOUP_TYPE_BYTE_ARRAY) struct: #GHashTable (%G_TYPE_HASH_TABLE) array: #GValueArray (%G_TYPE_VALUE_ARRAY)

    For structs, use a #GHashTable that maps strings to #GValue; soup_value_hash_new() and related methods can help with this.

    Parameters

    • method_name: string

      the name of the XML-RPC method

    • params: any[]

      arguments to method

    Returns string | null

  • xmlrpc_build_method_response(value: any): string | null
  • This creates a (successful) XML-RPC methodResponse and returns it as a string. To create a fault response, use soup_xmlrpc_build_fault().

    The glib type to XML-RPC type mapping is as with soup_xmlrpc_build_method_call(), qv.

    Parameters

    • value: any

      the return value

    Returns string | null

  • xmlrpc_build_request(method_name: string, params: GLib.Variant): string
  • This creates an XML-RPC methodCall and returns it as a string. This is the low-level method that soup_xmlrpc_message_new() is built on.

    params is a #GVariant tuple representing the method parameters.

    Serialization details:

    • "a{s*}" and "{s*}" are serialized as <struct>
    • "ay" is serialized as <base64>
    • Other arrays and tuples are serialized as <array>
    • booleans are serialized as <boolean>
    • byte, int16, uint16 and int32 are serialized as <int>
    • uint32 and int64 are serialized as the nonstandard <i8> type
    • doubles are serialized as <double>
    • Strings are serialized as <string>
    • Variants (i.e. "v" type) are unwrapped and their child is serialized.
    • #GVariants created by soup_xmlrpc_variant_new_datetime() are serialized as <dateTime.iso8601>
    • Other types are not supported and will return %NULL and set error. This notably includes: object-paths, signatures, uint64, handles, maybes and dictionaries with non-string keys.

    If params is floating, it is consumed.

    Parameters

    • method_name: string

      the name of the XML-RPC method

    • params: GLib.Variant

      a #GVariant tuple

    Returns string

  • This creates a (successful) XML-RPC methodResponse and returns it as a string. To create a fault response, use soup_xmlrpc_build_fault(). This is the low-level method that soup_xmlrpc_message_set_response() is built on.

    See soup_xmlrpc_build_request() for serialization details, but note that since a method can only have a single return value, value should not be a tuple here (unless the return value is an array).

    If value is floating, it is consumed.

    Parameters

    Returns string

  • xmlrpc_error_quark(): Quark
  • xmlrpc_fault_quark(): Quark
  • Creates an XML-RPC methodCall and returns a #SoupMessage, ready to send, for that method call.

    See soup_xmlrpc_build_request() for serialization details.

    If params is floating, it is consumed.

    Parameters

    • uri: string

      URI of the XML-RPC service

    • method_name: string

      the name of the XML-RPC method to invoke at uri

    • params: GLib.Variant

      a #GVariant tuple

    Returns Soup.Message

  • Sets the status code and response body of msg to indicate a successful XML-RPC call, with a return value given by value. To set a fault response, use soup_xmlrpc_message_set_fault().

    See soup_xmlrpc_build_request() for serialization details.

    If value is floating, it is consumed.

    Parameters

    Returns boolean

  • xmlrpc_parse_method_call(method_call: string, length: number): [boolean, string, GObject.ValueArray]
  • Parses method_call to get the name and parameters, and returns the parameter values in a #GValueArray; see also soup_xmlrpc_extract_method_call(), which is more convenient if you know in advance what the types of the parameters will be.

    Parameters

    • method_call: string

      the XML-RPC methodCall string

    • length: number

      the length of method_call, or -1 if it is NUL-terminated

    Returns [boolean, string, GObject.ValueArray]

  • xmlrpc_parse_method_response(method_response: string, length: number): [boolean, any]
  • Parses method_response and returns the return value in value. If method_response is a fault, value will be unchanged, and error will be set to an error of type %SOUP_XMLRPC_FAULT, with the error #code containing the fault code, and the error #message containing the fault string. (If method_response cannot be parsed at all, soup_xmlrpc_parse_method_response() will return %FALSE, but error will be unset.)

    Parameters

    • method_response: string

      the XML-RPC methodResponse string

    • length: number

      the length of method_response, or -1 if it is NUL-terminated

    Returns [boolean, any]

  • xmlrpc_parse_request(method_call: string, length: number): [string, XMLRPCParams]
  • Parses method_call and return the method name. Method parameters can be parsed later using soup_xmlrpc_params_parse().

    Parameters

    • method_call: string

      the XML-RPC methodCall string

    • length: number

      the length of method_call, or -1 if it is NUL-terminated

    Returns [string, XMLRPCParams]

  • xmlrpc_parse_response(method_response: string, length: number, signature: string): GLib.Variant
  • Parses method_response and returns the return value. If method_response is a fault, %NULL is returned, and error will be set to an error in the %SOUP_XMLRPC_FAULT domain, with the error code containing the fault code, and the error message containing the fault string. If method_response cannot be parsed, %NULL is returned, and error will be set to an error in the %SOUP_XMLRPC_ERROR domain.

    See soup_xmlrpc_params_parse() for deserialization details.

    Parameters

    • method_response: string

      the XML-RPC methodResponse string

    • length: number

      the length of method_response, or -1 if it is NUL-terminated

    • signature: string

      A valid #GVariant type string, or %NULL

    Returns GLib.Variant

  • Get the #SoupDate from special #GVariant created by soup_xmlrpc_variant_new_datetime() or by parsing a <dateTime.iso8601> node. See soup_xmlrpc_params_parse().

    If variant does not contain a datetime it will return an error but it is not considered a programmer error because it generally means parameters received are not in the expected type.

    Parameters

    Returns Soup.Date

  • Construct a special #GVariant used to serialize a <dateTime.iso8601> node. See soup_xmlrpc_build_request().

    The actual type of the returned #GVariant is unspecified and "v" or "*" should be used in variant format strings. For example: args = g_variant_new ("(v)", soup_xmlrpc_variant_new_datetime (date));

    Parameters

    Returns GLib.Variant

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method