Handles the subset of RFC 3986 URIs relevant to HTTP clients:
scheme://[user:pass@]host[:port]/path[?query][#fragment]
Only http and https schemes are supported. Fragment is parsed
but ignored for request purposes (not sent to server per RFC 7230 §5.1).
Component boundaries follow RFC 3986 §3: the fragment starts at the
first #, and the authority ends at the first /, ? or #,
so http://evil.com?@good.com/ has host evil.com and query
@good.com/ (an @ in the query is never userinfo). Userinfo ends at the last
@ of the authority, so http://a@evil.com@good.com/ has host
good.com and no host ever contains @.
Example:
mojo var u = Url.parse("https://api.example.com:8443/v1/items?filter=active") print(u.host) # api.example.com print(u.port) # 8443 print(u.path) # /v1/items print(u.query) # filter=active