Constructs a URI object.
Name | Type | Description |
---|---|---|
uri |
string | URI | A string or URI object to create the object from. |
Methods
-
Simple String Comparison of two URIs. See RFC 3986 section 6.2.1. To perform more thorough comparison, you can normalise the URI objects.
-
Returns the authority part of the URI. In "http://example.com:80/a/b?x#y" this is "example.com:80".
-
Returns the fragment part of the URI. In "http://example.com:80/a/b?x#y" this is "y".
-
Returns the path part of the URI. In "http://example.com:80/a/b?x#y" this is "/a/b". In "mailto:mike@example.com" this is "mike@example.com".
-
Returns the query part of the URI. In "http://example.com:80/a/b?x#y" this is "x".
-
Returns the scheme part of the URI. In "http://example.com:80/a/b?x#y" this is "http".
-
Tests whether the URI is an absolute URI. See RFC 3986 section 4.3.
-
Tests whether the URI is a same-document reference. See RFC 3986 section 4.4. To perform more thorough comparison, you can normalise the URI objects.
-
Normalizes the URI using syntax-based normalization. This includes case normalization, percent-encoding normalization and path segment normalization. XXX: Percent-encoding normalization does not escape characters that need to be escaped. (Although that would not be a valid URI in the first place. See validate().) See RFC 3986 section 6.2.2.
-
Resolve a relative URI (this) against a base URI. The base URI must be an absolute URI. See RFC 3986 section 5.2
-
Serialises the URI to a string.