std::url
A utility module for handling URLs.
Functions
-
parse_query(query: str) -> err|map[str, vec[str]]
-
Parses a URL-encoded query string.
-
Returns a
map
mappingstr
keys to vectors ofstr
values. -
Returns an
err
if the query string is invalidly-encoded.
The input can be a full URL — everything up to the first
?
will be ignored. -
Returns a
-
url_decode(input: str) -> str|err
-
Returns a new string containing the URL-decoded content of the input string. Returns an error if the input is invalidly-encoded.
-
url_encode(input: str) -> str
-
Returns a new string containing the URL-encoded content of the input string.