Skip to content

ParsedURL

[Source]

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.

class val ParsedURL

Public fields

let scheme: ((SchemeHTTP val | SchemeHTTPS val) & _Scheme val)

[Source]


let host: String val

[Source]


let port: String val

[Source]


let path: String val

[Source]


let query: (String val | None val)

[Source]


Public Functions

request_path

[Source]

The HTTP request target: path with query string appended if present.

Always starts with /. For example, /api/v1?key=value.

fun box request_path()
: String val

Returns


is_ssl

[Source]

True if the scheme is HTTPS.

fun box is_ssl()
: Bool val

Returns