Http module

parse_query

procedureextensionexperimentalSource

Splits a=1&b=two&flag into decoded pairs (flag has an empty value). The pairs and the strings that needed decoding come from context.allocator; the server calls this with the temporary allocator.

Example
pairs := parse_query("name=Ada%20L&tag=a&tag=b&flag");
assert(pairs.count == 4);
assert(pairs[0].key == "name" && pairs[0].value == "Ada L");
assert(pairs[3].key == "flag" && pairs[3].value == "");

Doesn't run in the browser (skipped on wasm).

parse_query :: (query: string) -> [] Pair

Parameters

query: string

Returns

[] Pair

See also