Signature
StringMap parse_query(String q)
Parameters
q : string containing URL parameters
return value : a StringMap containing the parameters
Decodes a query-string fragment such as a=b&c=d into a StringMap.
Parsing rules:
pairs are separated on
&each pair is split on the first raw
=onlyboth key and value are URL-decoded
keyless flags such as
previeware present with an empty string valueempty pairs, including a trailing
&, are ignoredrepeated keys use the last value seen
Examples:
This is useful when you need to work with URL parameter data outside the normal request parsing flow.
Example
StringMap q = parse_query("name=Ada&role=admin");
print(q["name"], "\n");
Output
Ada