A URL, as defined by RFC 3986.
RFC 6874 IPv6 zone literals are also supported.
Known subtypes in package:
Known usages in package:
All versions:
Every component is held percent-encoded, in its raw property, such as rawPath:
Url() encodes whatever a component cannot hold literally, and a component that is set by hand,
or amended, has to be encoded already.
The percent-decoded form of each component is available without the raw prefix, such as
path.
The percent-encoded host, or null if this URL has no authority.
A null host is not the same as an empty one: file:/tmp has no host, file:///tmp has an
empty one.
An IPv6 address must be enclosed in brackets, as in [::1].
It may carry a zone identifier, as described in RFC 6874.
Anything else is a registered name, which cannot contain [, ] or : literally.
The percent-encoded path, or the empty string if this URL has none.
With a rawHost, the path is empty or starts with /.
Without one, it may be rootless, as in mailto:user@example.com.
Without a scheme, its first segment cannot contain :.
To change the path without encoding it first, use resolve(), which is as lenient as Url().
Unlike amending, this drops rawQuery and rawFragment.
An encoded / is decoded like any other octet, so it cannot be distinguished from a / that
separates segments.
pathSegments disambiguates between separator and literal / characters.
pathSegments does not tell if the path is absolute or not.
A relative URL reference "a/b" also has path segments List("a", "b").
To disambiguate between the two, use hasAbsolutePath.
The percent-decoded parameters of rawQuery, or null if this URL has no query.
rawQuery is read as application/x-www-form-urlencoded.
A name that repeats holds the values of all its occurrences, in the order they are written.
A parameter that states no = holds no value at all, and is left out; this is not the same as
a bare =, which gives it the empty string.
Facts:
net.Url("https://example.com/?q=a+b&q=c").queryParameters["q"] == new Listing { "a b"; "c" }
net.Url("https://example.com/?").queryParameters.isEmpty
net.Url("https://example.com/").queryParameters == null
The normalized version of this URL, following syntax-based normalization as described in
section 6.2.2 of RFC 3986.
scheme and rawHost are lowercased, as they are case-insensitive.
Percent-encoding is normalized: an octet standing for an unreserved character is decoded, and
any other octet is kept, with its hex digits uppercased.
Dot segments (./ and ../) are only removed from an absolute rawPath.
A URL with a rawHost and no path is given the path /, which names the same resource.
Does not perform normalization that requires knowing the scheme, such as removing a default
port (see section 6.2.3).
ref is either a relative reference, which is resolved against this URL, or an absolute URL,
which replaces it entirely.
Dot segments (./ and ../) are removed from the result's path, normalizing it.
Throws if ref is a string that cannot be parsed, or if this URL is itself a relative
reference.
Tells if value is a percent-encoded path that can sit next to a scheme and an authority, or,
when hasScheme or hasAuthority is false, next to no scheme or no authority.
A URL, as defined by RFC 3986. RFC 6874 IPv6 zone literals are also supported.