soup.global

Global functions for soup3 library

Functions 36

fnbool checkVersion(uint major, uint minor, uint micro)Like `funcCHECKVERSION`, but the check for soupcheck_version is at runtime instead of compile time.
fnsoup.cookie.Cookie[] cookiesFromRequest(soup.message.Message msg)Parses msg's Cookie request header and returns a [glib.slist.SList] of [soup.cookie.Cookie]s.
fnsoup.cookie.Cookie[] cookiesFromResponse(soup.message.Message msg)Parses msg's Set-Cookie response headers and returns a [glib.slist.SList] of [soup.cookie.Cookie]s.
fnstring cookiesToCookieHeader(soup.cookie.Cookie[] cookies)Serializes 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)Adds the name and value of each cookie in cookies to msg's "Cookie" request.
fnvoid cookiesToResponse(soup.cookie.Cookie[] cookies, soup.message.Message msg)Appends a "Set-Cookie" response header to msg for each cookie in cookies.
fnglib.date_time.DateTime dateTimeNewFromHttpString(string dateString)Parses date_string and tries to extract a date from it.
fnstring dateTimeToString(glib.date_time.DateTime date, soup.types.DateFormat format)Converts date to a string in the format described by format.
fnstring[string] formDecode(string encodedForm)Decodes form.
fnstring[string] formDecodeMultipart(soup.multipart.Multipart multipart, string fileControlName, out string filename, out string contentType, out glib.bytes.Bytes file)Decodes the "multipart/form-data" request in multipart.
fnstring formEncodeHash(string[string] formDataSet)Encodes formdataset into a value of type "application/x-www-form-urlencoded".
fnuint getMajorVersion()Returns the major version number of the libsoup library.
fnuint getMicroVersion()Returns the micro version number of the libsoup library.
fnuint getMinorVersion()Returns the minor version number of the libsoup library.
fnbool headerContains(string header, string token)Parses header to see if it contains the token token (matched case-insensitively).
fnvoid headerFreeParamList(string[string] paramList)Frees param_list.
fnvoid headerGStringAppendParam(glib.string_.String string_, string name, string value = null)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.
fnvoid headerGStringAppendParamQuoted(glib.string_.String string_, string name, string value)Appends something like `name="value"` to string, taking care to escape any quotes or backslashes in value.
fnstring[] headerParseList(string header)Parses a header whose content is described by RFC2616 as `#something`.
fnstring[string] headerParseParamList(string header)Parses a header which is a comma-delimited list of something like: `token [ "=" ( token | quoted-string ) ]`.
fnstring[string] headerParseParamListStrict(string header)A strict version of `funcheaderparseparam_list` that bails out if there are duplicate parameters.
fnstring[] headerParseQualityList(string header, out 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).
fnstring[string] headerParseSemiParamList(string header)Parses a header which is a semicolon-delimited list of something like: `token [ "=" ( token | quoted-string ) ]`.
fnstring[string] headerParseSemiParamListStrict(string header)A strict version of `funcheaderparsesemiparamlist` that bails out if there are duplicate parameters.
fnbool headersParse(string str, soup.message_headers.MessageHeaders dest)Parses 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)Parses the headers of an HTTP request in str and stores the results in reqmethod, reqpath, ver, and req_headers.
fnbool headersParseResponse(string str, soup.message_headers.MessageHeaders headers, out soup.types.HTTPVersion ver, out uint statusCode, out string reasonPhrase)Parses the headers of an HTTP response in str and stores the results in ver, statuscode, reasonphrase, and headers.
fnbool headersParseStatusLine(string statusLine, out soup.types.HTTPVersion ver, out uint statusCode, out string reasonPhrase)Parses the HTTP Status-Line string in statusline into ver, statuscode, and reason_phrase.
fnbool tldDomainIsPublicSuffix(string domain)Looks 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)Decodes the given data URI and returns its contents and content_type.
fnbool uriEqual(glib.uri.Uri uri1, glib.uri.Uri uri2)Tests 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)Adds 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)Examines the method and request headers in msg and (assuming msg contains a valid handshake request), fills in the handshake response.