UrlBuilder | @here/olp-sdk-ts
Class UrlBuilder
Hierarchy
- UrlBuilder
Index
Constructors
constructor
Default constructor.
Parameters
url: string
The base URL.
hasQuery: boolean = false
Whether the base URL already contains query parameters.
Returns UrlBuilder
Properties
has Query
url
Methods
append Query
Appends a query parameter to the URL, either using '&key=value' or '?key=value' depending on the hasQuery parameter.
Escapes all strings using
encodeURIComponent.String arrays are concatenated using commas.
Parameters
key: string
The key of the query parameter.
Optional value: string | number | boolean | string[] | number[]
The value of the query parameter.
operator: string = "="
Returns void
Static stringify Query
Static method that creates an URL query string from a key, value pair provided as param *
Parameters
values: {}
[key: string]: string | number | string[] | undefined
Returns string
Static to String
Static method that converts the parameter to a string
Parameters
param: string | number
either a string or a number to be converted.
Returns string
Generated using TypeDoc
Helper class that builds URLs from a baseUrl and given query parameters