ParsedURL¶
A parsed URL with scheme, host, port, path, and optional query string.
Produced by URL.parse(). Fields are validated and normalized: the scheme
is lowercase, the host has IPv6 brackets stripped, the port is a decimal
string (defaulting to "80" for HTTP or "443" for HTTPS when omitted),
and the path defaults to "/" when absent.
Use request_path() to get the combined path and query string for the
HTTP request target. Use is_ssl() to determine whether TLS is needed.
Public fields¶
let scheme: ((SchemeHTTP val | SchemeHTTPS val) & _Scheme val)¶
let host: String val¶
let port: String val¶
let path: String val¶
let query: (String val | None val)¶
Public Functions¶
request_path¶
The HTTP request target: path with query string appended if present.
Always starts with /. For example, /api/v1?key=value.
Returns¶
- String val
is_ssl¶
True if the scheme is HTTPS.
Returns¶
- Bool val