uce/site/doc/pages/parse_uri.txt
2026-06-16 12:21:31 +00:00

27 lines
613 B
Plaintext

:sig
URI parse_uri(String uri_string)
:params
uri_string : URI or URL string
return value : URI object with `parts` and `query` maps
:see
>uri
parse_query
uri_decode
uri_encode
:content
Parses a URI into its component maps.
`return.parts` contains the parsed URI fields. `return.query` contains query parameters decoded with the same rules as `parse_query()`.
Example:
Use `parse_uri()` when you need to inspect a full URL. Use `parse_query()` when you only have the query string.
:example
URI uri = parse_uri("https://example.test/docs?name=Ada");
print(uri.parts["path"], " ", uri.query["name"], "\n");