ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
137 stars 61 forks source link

Need a setQueryParams function in http request #313

Open ThisaruGuruge opened 4 years ago

ThisaruGuruge commented 4 years ago

Description: When we call HTTP endpoints, we often use query parameters. Currently, there is a method to get query parameters as map in http:Request. But, we cannot set query parameters easily.

The way to do it now is to create a string concatenating the parameters one by one. It's better if we have a function to set query parameters using a map.

The usage may look like following:

http:Request request = new;
map<string[]> queryParameters = {
    param1: ["value11", "value12"],
    param2: ["value21"]
};
http:ClientError? result = request.setQueryParams(queryParams);
adityaMemeraki commented 4 days ago

Hi Team, is this issue open for contribution? If so, I'd be happy to work on this.

adityaMemeraki commented 3 days ago

Hi @TharmiganK @keizer619, checking in on the above.