soup.global
Global functions for soup3 library
fn checkVersion cookiesFromRequest cookiesFromResponse cookiesToCookieHeader cookiesToRequest cookiesToResponse dateTimeNewFromHttpString dateTimeToString formDecode formDecodeMultipart formEncodeHash getMajorVersion getMicroVersion getMinorVersion headerContains headerFreeParamList headerGStringAppendParam headerGStringAppendParamQuoted headerParseList headerParseParamList headerParseParamListStrict headerParseQualityList headerParseSemiParamList headerParseSemiParamListStrict headersParse headersParseRequest headersParseResponse headersParseStatusLine tldDomainIsPublicSuffix tldGetBaseDomain uriDecodeDataUri uriEqual websocketClientPrepareHandshake websocketClientVerifyHandshake websocketServerCheckHandshake websocketServerProcessHandshake
Functions 36
fn
bool checkVersion(uint major, uint minor, uint micro)Like `funcCHECKVERSION`, but the check for soupcheck_version is at runtime instead of compile time.fn
soup.cookie.Cookie[] cookiesFromRequest(soup.message.Message msg)Parses msg's Cookie request header and returns a [glib.slist.SList] of [soup.cookie.Cookie]s.fn
soup.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.fn
string 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.fn
void cookiesToRequest(soup.cookie.Cookie[] cookies, soup.message.Message msg)Adds the name and value of each cookie in cookies to msg's "Cookie" request.fn
void cookiesToResponse(soup.cookie.Cookie[] cookies, soup.message.Message msg)Appends a "Set-Cookie" response header to msg for each cookie in cookies.fn
glib.date_time.DateTime dateTimeNewFromHttpString(string dateString)Parses date_string and tries to extract a date from it.fn
string dateTimeToString(glib.date_time.DateTime date, soup.types.DateFormat format)Converts date to a string in the format described by format.fn
string[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.fn
string formEncodeHash(string[string] formDataSet)Encodes formdataset into a value of type "application/x-www-form-urlencoded".fn
bool headerContains(string header, string token)Parses header to see if it contains the token token (matched case-insensitively).fn
void 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.fn
void 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.fn
string[] headerParseList(string header)Parses a header whose content is described by RFC2616 as `#something`.fn
string[string] headerParseParamList(string header)Parses a header which is a comma-delimited list of something like: `token [ "=" ( token | quoted-string ) ]`.fn
string[string] headerParseParamListStrict(string header)A strict version of `funcheaderparseparam_list` that bails out if there are duplicate parameters.fn
string[] 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).fn
string[string] headerParseSemiParamList(string header)Parses a header which is a semicolon-delimited list of something like: `token [ "=" ( token | quoted-string ) ]`.fn
string[string] headerParseSemiParamListStrict(string header)A strict version of `funcheaderparsesemiparamlist` that bails out if there are duplicate parameters.fn
bool 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.fn
uint 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.fn
bool 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.fn
bool 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.fn
bool tldDomainIsPublicSuffix(string domain)Looks whether the domain passed as argument is a public domain suffix (.org, .com, .co.uk, etc) or not.fn
glib.bytes.Bytes uriDecodeDataUri(string uri, out string contentType)Decodes the given data URI and returns its contents and content_type.fn
bool uriEqual(glib.uri.Uri uri1, glib.uri.Uri uri2)Tests whether or not uri1 and uri2 are equal in all parts.fn
void 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.fn
bool 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).fn
bool 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.fn
bool 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.