Class: MultiValueQueryParameter
- Last UpdatedMay 21, 2025
- 1 minute read
This class represents the set of values to be associated to a key in cases where it is required to be repeated multiple times in a query string.
Name | Type | Description |
---|---|---|
values |
Array.<(string|number)> |
The list of values to be associated to a key in a query string. The order of the values in the list will be preserved to build the query string. |
Throws:
-
in case the argument of the constructor is not an array or its elements have types different from
string
andnumber
.
Example
const myValues = new H.service.Url.MultiValueQueryParameter(['val1', 'val2']);
const url = new H.service.Url('https', 'host.com', '', {myKey: myValues});
url.toString(); // => 'https://host.com?myKey=val1&myKey=val2'
Methods
-
Returns the array of values.
Returns:
Type Description Array.<(string|number)>