Skip to main content

URI Experimental

Represents a Uniform Resource Identifier (URI).

export class URI {
has_fragment: Bool { get }
has_port: Bool { get }
has_query: Bool { get }
has_scheme: Bool { get }
scheme: String { get }
host: String { get }
port: String { get }
path: String { get }
query: String { get }
fragment: String { get }

equal(to other: URI) -> Bool
to_string() -> String
}
import { URI } from uri

Constructor

None. This class cannot be instantiated directly. Use parse_uri or parse_uri_list to obtain instances.

Properties

has_fragment: Bool (get)

Whether the URI has a fragment component.

has_port: Bool (get)

Whether the URI has a port component.

has_query: Bool (get)

Whether the URI has a query component.

has_scheme: Bool (get)

Whether the URI has a scheme component.

scheme: String (get)

The scheme component (e.g. https, file).

host: String (get)

The host component.

port: String (get)

The port component as a string.

path: String (get)

The path component.

query: String (get)

The query component (without the leading ?).

fragment: String (get)

The fragment component (without the leading #).

Methods

equal(to other: URI) -> (Bool)

Returns whether the URI compares equal to other.

to_string() -> (String)

Returns the full URI as a string.