Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions uriParseQuery

1
2
3
4
5
6
7
8
module juptune.http.uri;

Result uriParseQuery(
    const char[] chars, 
    const char[] query, 
    const char[] next, 
    UriParseHints hints
);

Documentation

Parses the query of a URI.

Valid Formats

queryIsEmpty ->

percentEncodedQuery -> ?que%20ry#fragment, e.g. "?some%20query#some-fragment"

!queryIsEmpty -> ?query#fragment, e.g. "?some=query#some-fragment"

Notes

Given the string "?some=query#some-fragment", the queryparameter will be set to "some=query", and the nextparameter will be set to "#some-fragment".

The output of all outparameters is undefined if the function returns an error.

While percent encoding is validated, it is not decoded.

Params

Throws

UriError.queryIsInvalidif the query contains an invalid character

UriError.queryIsInvalidif the query contains an invalid percent encoded character

UriError.queryIsInvalidif the first character is not '?'

Returns

A Resultindicating whether the parsing was successful or not.