Members
hash
Get the hash portion of the Uri.
hostname
Set the hostname for the Uri.
hostname
Get the hostname portion of the Uri.
origin
Get the origin portion of the Uri.
path
Get the path portion of the Uri.
protocol
Set the protocol for the Uri.
protocol
Get the protocol portion of the Uri.
search
Get the search portion of the Uri detailing the query parameters as a string.
Methods
addQueryParam(key, value)
Additively sets a query string parameter. It is possible to add multiple query parameter values with the same key using this function.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | The key of the query parameter to add. |
value |
String | Number | Boolean | The value of the added query parameter. |
addQueryParams(queryMap)
Add a batch of query parameters.
Parameters:
| Name | Type | Description |
|---|---|---|
queryMap |
Object | A list of key-value pairs to add as query parameters. It is possible to add multiple query parameter values with the same key using this function. |
addSegments(…segments)
Add path segments to the Uri.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
segments |
String |
<repeatable> |
The segments to be added to the Uri. |
getQueryParam(key) → {String}
Get a query parameter value.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | The key of the query string value to fetch. |
Returns:
The value of the query parameter.
- Type
- String
removeQueryParam(key)
Remove a query string parameter from the Uri.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | The key of the query parameter to remove. |
setQueryParam(key, value)
Set the value of an existing query parameter, or add it if it does not exist.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String | The key of the query parameter to add. |
value |
String | Number | Boolean | The value of the added query parameter. |
setQueryParams(queryMap)
Set a batch of query parameters.
Parameters:
| Name | Type | Description |
|---|---|---|
queryMap |
Object | A list of key-value pairs to set as query parameters. If any of the keys of this input object conflict with existing query parameter keys, they will be replaced. |
toString() → {String}
Get a string representation of the current state of the Uri.
Returns:
The Uri string.
- Type
- String