URL

A Unique Resource Locator.

URLs can be parsed (see parseURL) and implicitly convert to strings.

Alias This

toString

Implicitly convert URLs to strings.

Members

Functions

opBinary
URL opBinary(string subsequentPath)

The append operator (~).

opCmp
int opCmp(URL other)

Compare two URLs.

opEquals
bool opEquals(string other)
bool opEquals(URL other)

Equality checks.

opOpAssign
URL opOpAssign(string subsequentPath)

The append-in-place operator (~=).

resolve
URL resolve(string other)

Convert a relative URL to an absolute URL.

toHash
hash_t toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
toHumanReadableString
string toHumanReadableString()

Convert this URL to a string. * The string is intended to be human-readable rather than machine-readable.

toPathAndQueryString
string toPathAndQueryString()

Convert the path and query string of this URL to a string.

toString
string toString()

Convert this URL to a string. The string is properly formatted and usable for, eg, a web request.

Properties

port
ushort port [@property getter]

The port. * This is inferred from the scheme if it isn't present in the URL itself. If the scheme is not known and the port is not present, the port will be given as 0. For some schemes, port will not be sensible -- for instance, file or chrome-extension.

port
ushort port [@property setter]

* Set the port.

Variables

fragment
string fragment;

The fragment. In web documents, this typically refers to an anchor element. For instance, in the URL https://cnn.com/news/story/17774#header2, the fragment is "header2".

host
string host;

The hostname.

pass
string pass;

The password in this URL. Usually absent.

path
string path;

The path.

providedPort
ushort providedPort;

The port that was explicitly provided in the URL.

queryParams
QueryParams queryParams;

The query parameters associated with this URL.

scheme
string scheme;

The URL scheme. For instance, ssh, ftp, or https.

user
string user;

The username in this URL. Usually absent. If present, there will also be a password.

Meta