getXyz
/setXyz
methods return the decoded part
-- sogoog.Uri.parse('/foo%20bar').getPath()
will return the
decoded path, /foo bar
.
The constructor accepts an optional unparsed, raw URI string. The parser
is relaxed, so special characters that aren't escaped but don't cause
ambiguities will not cause parse failures.
All setters return this
and so may be chained, a la
goog.Uri.parse('/foo').setFragment('part').toString()
.
goog.Uri |
opt_uri
: *=
Optional string URI to parse
(use goog.Uri.create() to create a URI from parts), or if
a goog.Uri is passed, a clone is created.
|
opt_ignoreCase
: boolean=
If true, #getParameterValue will ignore
the case of the parameter name.
|
Clones the URI instance.
Returns: !goog.Uri
New instance of the URI object.
|
code » | |||
![]()
Checks if this Uri has been marked as read only, and if so, throws an error.
This should be called whenever any modifying function is called.
|
code » | |||
No description.
Returns: string
The decoded URI query, not including the ?.
|
code » | |||
No description.
Returns: string
The decoded domain.
|
code » | |||
No description.
Returns: string
The encoded URI query, not including the ?.
|
code » | |||
No description.
Returns: string
The URI fragment, not including the #.
|
code » | |||
No description.
Returns: boolean
Whether to ignore case.
|
code » | |||
Returns the first value for a given cgi parameter or undefined if the given
parameter name does not appear in the query string.
|
code » | |||
Returns the values for a given cgi parameter as a list of decoded
query parameter values.
|
code » | |||
No description.
Returns: string
The decoded path.
|
code » | |||
No description.
Returns: ?number
The port number.
|
code » | |||
No description.
Returns: string
The encoded URI query, not including the ?.
Warning: This method, unlike other getter methods, returns encoded
value, instead of decoded one.
|
code » | |||
Returns the query data.
Returns: !goog.Uri.QueryData
QueryData object.
|
code » | |||
No description.
Returns: string
The encoded scheme/protocol for the URI.
|
code » | |||
No description.
Returns: string
The decoded user info.
|
code » | |||
No description.
Returns: boolean
Whether the domain has been set.
|
code » | |||
No description.
Returns: boolean
Whether the URI has a fragment set.
|
code » | |||
No description.
Returns: boolean
Whether the path has been set.
|
code » | |||
No description.
Returns: boolean
Whether the port has been set.
|
code » | |||
No description.
Returns: boolean
Whether the query string has been set.
|
code » | |||
Returns true if this has the same domain as that of uri2.
|
code » | |||
No description.
Returns: boolean
Whether the scheme has been set.
|
code » | |||
No description.
Returns: boolean
Whether the user info has been set.
|
code » | |||
No description.
Returns: boolean
Whether the URI is read only.
|
code » | |||
Adds a random parameter to the Uri.
Returns: !goog.Uri
Reference to this Uri object.
|
code » | |||
Removes the named query parameter.
|
code » | |||
Resolves the given relative URI (a goog.Uri object), using the URI
represented by this instance as the base URI.
There are several kinds of relative URIs:
1. foo - replaces the last part of the path, the whole query and fragment 2. /foo - replaces the the path, the query and fragment 3. //foo - replaces everything from the domain on. foo is a domain name 4. ?foo - replace the query and fragment 5. #foo - replace the fragment only Additionally, if relative URI has a non-empty path, all ".." and "." segments will be resolved, as described in RFC 3986. |
code » | |||
Sets the domain.
|
code » | |||
Sets the URI fragment.
|
code » | |||
Sets whether to ignore case.
NOTE: If there are already key/value pairs in the QueryData, and
ignoreCase_ is set to false, the keys will all be lower-cased.
|
code » | |||
Sets the value of the named query parameters, clearing previous values for
that key.
|
code » | |||
Sets the values of the named query parameters, clearing previous values for
that key. Not new values will currently be moved to the end of the query
string.
So,
goog.Uri.parse('foo?a=b&c=d&e=f').setParameterValues('c', ['new'])
yields foo?a=b&e=f&c=new.
|
code » | |||
Sets the path.
|
code » | |||
Sets the port number.
Arguments:
Returns: !goog.Uri
Reference to this URI object.
|
code » | |||
Sets the URI query.
|
code » | |||
Sets the query data.
Arguments:
Returns: !goog.Uri
Reference to this URI object.
|
code » | |||
Sets whether Uri is read only. If this goog.Uri is read-only,
enforceReadOnly_ will be called at the start of any function that may modify
this Uri.
|
code » | |||
Sets the scheme/protocol.
|
code » | |||
Sets the userInfo.
|
code » | |||
No description.
Returns: string
The string form of the url.
|
code » |
![]()
Domain part, e.g. "www.google.com".
|
Code » | |
![]()
The fragment without the #.
|
Code » | |
![]()
Whether or not to ignore case when comparing query params.
|
Code » | |
![]()
Whether or not this Uri should be treated as Read Only.
|
Code » | |
![]()
Path, e.g. "/tests/img.png".
|
Code » | |
![]()
Port, e.g. 8080.
|
Code » | |
Object representing query data.
|
Code » | |
![]()
Scheme such as "http".
|
Code » | |
![]()
User credentials in the form "username:password".
|
Code » |
![]()
Creates a new goog.Uri object from unencoded parts.
Arguments:
Returns: !goog.Uri
The new URI object.
|
code » | |||||||||
Decodes a value or returns the empty string if it isn't defined or empty.
|
code » | |||||||||
Converts a character in [\01-\177] to its unicode character equivalent.
|
code » | |||||||||
If unescapedPart is non null, then escapes any characters in it that aren't
valid characters in a url and also escapes any special characters that
appear in extra.
|
code » | |||||||||
Checks whether two URIs have the same domain.
|
code » | |||||||||
Creates a uri from the string form. Basically an alias of new goog.Uri().
If a Uri object is passed to parse then it will return a clone of the object.
Arguments:
Returns: !goog.Uri
The new URI object.
|
code » | |||||||||
Removes dot segments in given path component, as described in
RFC 3986, section 5.2.4.
|
code » | |||||||||
Resolves a relative Uri against a base Uri, accepting both strings and
Uri objects.
Arguments:
Returns: !goog.Uri
Resolved uri.
|
code » |
![]()
Parameter name added to stop caching.
|
Code » | |
![]()
If true, we preserve the type of query parameters set programmatically.
This means that if you set a parameter to a boolean, and then call
getParameterValue, you will get a boolean back.
If false, we will coerce parameters to strings, just as they would
appear in real URIs.
TODO(nicksantos): Remove this once people have time to fix all tests.
|
Code » | |
![]()
Regular expression for characters that are disallowed in an absolute path.
|
Code » | |
![]()
Regular expression for characters that are disallowed in the fragment.
|
Code » | |
![]()
Regular expression for characters that are disallowed in the query.
|
Code » | |
![]()
Regular expression for characters that are disallowed in a relative path.
|
Code » | |
![]()
Regular expression for characters that are disallowed in the scheme or
userInfo part of the URI.
|
Code » |