Class: Uri

bitbucket/util/navbuilder. Uri

new Uri()

An object representation of a URI with methods allowing you to read and modify the URI.

NOTE: The Uri constructor is not exposed. Use bitbucket/util/navbuilder.parse to create an instance.

Source:

Methods

addQueryParam(paramKey, paramValue) → {bitbucket/util/navbuilder.Uri}

Add a query parameter value. If the key is already present in the URI, the key will be repeated.

Parameters:
Name Type Description
paramKey string

The key/name of the parameter.

paramValue string

The value for the parameter.

Source:
Returns:
Type
bitbucket/util/navbuilder.Uri

anchor() → {string}

Get just the anchor/hash portion of the URI.

Source:
Returns:
Type
string

deleteQueryParam(paramKey) → {bitbucket/util/navbuilder.Uri}

Remove a query parameter from the URI.

Parameters:
Name Type Description
paramKey string

The key/name of the parameter.

Source:
Returns:
Type
bitbucket/util/navbuilder.Uri

getQueryParamValue(paramKey) → {string}

Get a query parameter value. If the key is repeated in the URI, the first instance will be returned.

Parameters:
Name Type Description
paramKey string

The key/name of the parameter.

Source:
Returns:
Type
string

getQueryParamValues(paramKey) → {Array.<string>}

Get an array of query parameter values for a key.

Parameters:
Name Type Description
paramKey string

The key/name of the parameter.

Source:
Returns:
Type
Array.<string>

path() → {string}

Get just the path portion of the URI.

Source:
Returns:
Type
string

query() → {bitbucket/util/navbuilder.Query}

Get just the query string portion of the URI, as an object.

Source:
Returns:
Type
bitbucket/util/navbuilder.Query

replaceQueryParam(paramKey, paramValue) → {bitbucket/util/navbuilder.Uri}

Add a query parameter value. If the key is already present in the URI, it will be replaced.

Parameters:
Name Type Description
paramKey string

The key/name of the parameter.

paramValue string

The value for the parameter.

Source:
Returns:
Type
bitbucket/util/navbuilder.Uri

toString() → {string}

Serialize the Uri instance.

Source:
Returns:
Type
string