Closed
Description
I found no official way to pass query string parameters in a RestClient request.
I would have expected something like:
const options = {
queryParameters: {
lang: "en",
terms: ["foo bar", 4.2, "baz"]
}
}
const response = await restClient.get<ISomeResponse>("/search", options);
where queryParameters would be of type:
undefined | { [name: string]: string | number | (string | number)[] }
Of course, typed-rest-client
would have the responsibility of transforming queryParameters to a proper URL query parameter in the correct format.
e.g. { lang: "en", terms: ["foo bar", 4.2, "baz"] }
would become ?lang=en&terms=foo%20bar+4.2+baz
in the corresponding request URL.
Am I missing something? 🤔