soup.global

Global functions for soup3 library

Functions 36

fnbool checkVersion(uint major, uint minor, uint micro) nothrowLike `funcCHECK_VERSION`, but the check for soup_check_version is at runtime instead of compile time.
fnsoup.cookie.Cookie[] cookiesFromRequest(soup.message.Message msg) nothrowParses msg's Cookie request header and returns a [glib.slist.SList] of [soup.cookie.Cookie]s.
fnsoup.cookie.Cookie[] cookiesFromResponse(soup.message.Message msg) nothrowParses msg's Set-Cookie response headers and returns a [glib.slist.SList] of [soup.cookie.Cookie]s.
fnstring cookiesToCookieHeader(soup.cookie.Cookie[] cookies) nothrowSerializes a [glib.slist.SList] of #SoupCookie into a string suitable for setting as the value of the "Cookie" header.
fnvoid cookiesToRequest(soup.cookie.Cookie[] cookies, soup.message.Message msg) nothrowAdds the name and value of each cookie in cookies to msg's "Cookie" request.
fnvoid cookiesToResponse(soup.cookie.Cookie[] cookies, soup.message.Message msg) nothrowAppends a "Set-Cookie" response header to msg for each cookie in cookies.
fnglib.date_time.DateTime dateTimeNewFromHttpString(string dateString) nothrowParses date_string and tries to extract a date from it.
fnstring dateTimeToString(glib.date_time.DateTime date, soup.types.DateFormat format) nothrowConverts date to a string in the format described by format.
fnstring[string] formDecode(string encodedForm) nothrowDecodes form.
fnstring[string] formDecodeMultipart(soup.multipart.Multipart multipart, string fileControlName, out string filename, out string contentType, out glib.bytes.Bytes file) nothrowDecodes the "multipart/form-data" request in multipart.
fnstring formEncodeHash(string[string] formDataSet) nothrowEncodes form_data_set into a value of type "application/x-www-form-urlencoded".
fnuint getMajorVersion() nothrowReturns the major version number of the libsoup library.
fnuint getMicroVersion() nothrowReturns the micro version number of the libsoup library.
fnuint getMinorVersion() nothrowReturns the minor version number of the libsoup library.
fnbool headerContains(string header, string token) nothrowParses header to see if it contains the token token (matched case-insensitively).
fnvoid headerFreeParamList(string[string] paramList) nothrowFrees param_list.
fnvoid headerGStringAppendParam(glib.string_.String string_, string name, string value = null) nothrowAppends something like `name=value` to string, taking care to quote value if needed, and if so, to escape any quotes or backslashes in value.
fnvoid headerGStringAppendParamQuoted(glib.string_.String string_, string name, string value) nothrowAppends something like `name="value"` to string, taking care to escape any quotes or backslashes in value.
fnstring[] headerParseList(string header) nothrowParses a header whose content is described by RFC2616 as `#something`.
fnstring[string] headerParseParamList(string header) nothrowParses a header which is a comma-delimited list of something like: `token [ "=" ( token | quoted-string ) ]`.
fnstring[string] headerParseParamListStrict(string header) nothrowA strict version of `funcheader_parse_param_list` that bails out if there are duplicate parameters.
fnstring[] headerParseQualityList(string header, out string[] unacceptable) nothrowParses a header whose content is a list of items with optional "qvalue"s (eg, Accept, Accept-Charset, Accept-Encoding, Accept-Language, TE).
fnstring[string] headerParseSemiParamList(string header) nothrowParses a header which is a semicolon-delimited list of something like: `token [ "=" ( token | quoted-string ) ]`.
fnstring[string] headerParseSemiParamListStrict(string header) nothrowA strict version of `funcheader_parse_semi_param_list` that bails out if there are duplicate parameters.
fnbool headersParse(string str, soup.message_headers.MessageHeaders dest) nothrowParses the headers of an HTTP request or response in str and stores the results in dest.
fnuint headersParseRequest(string str, soup.message_headers.MessageHeaders reqHeaders, out string reqMethod, out string reqPath, out soup.types.HTTPVersion ver) nothrowParses the headers of an HTTP request in str and stores the results in req_method, req_path, ver, and req_headers.
fnbool headersParseResponse(string str, soup.message_headers.MessageHeaders headers, out soup.types.HTTPVersion ver, out uint statusCode, out string reasonPhrase) nothrowParses the headers of an HTTP response in str and stores the results in ver, status_code, reason_phrase, and headers.
fnbool headersParseStatusLine(string statusLine, out soup.types.HTTPVersion ver, out uint statusCode, out string reasonPhrase) nothrowParses the HTTP Status-Line string in status_line into ver, status_code, and reason_phrase.
fnbool tldDomainIsPublicSuffix(string domain) nothrowLooks whether the domain passed as argument is a public domain suffix (.org, .com, .co.uk, etc) or not.
fnstring tldGetBaseDomain(string hostname)Finds the base domain for a given hostname
fnglib.bytes.Bytes uriDecodeDataUri(string uri, out string contentType) nothrowDecodes the given data URI and returns its contents and content_type.
fnbool uriEqual(glib.uri.Uri uri1, glib.uri.Uri uri2) nothrowTests whether or not uri1 and uri2 are equal in all parts.
fnvoid websocketClientPrepareHandshake(soup.message.Message msg, string origin = null, string[] protocols = null, gobject.type_class.TypeClass[] supportedExtensions = null) nothrowAdds the necessary headers to msg to request a WebSocket handshake including supported WebSocket extensions.
fnbool websocketClientVerifyHandshake(soup.message.Message msg, gobject.type_class.TypeClass[] supportedExtensions, out soup.websocket_extension.WebsocketExtension[] acceptedExtensions)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).
fnbool websocketServerCheckHandshake(soup.server_message.ServerMessage msg, string origin = null, string[] protocols = null, gobject.type_class.TypeClass[] supportedExtensions = null)Examines the method and request headers in msg and determines whether msg contains a valid handshake request.
fnbool websocketServerProcessHandshake(soup.server_message.ServerMessage msg, string expectedOrigin, string[] protocols, gobject.type_class.TypeClass[] supportedExtensions, out soup.websocket_extension.WebsocketExtension[] acceptedExtensions) nothrowExamines the method and request headers in msg and (assuming msg contains a valid handshake request), fills in the handshake response.