#Parse, modify and stringify URL query strings
1 messages · Page 1 of 1 (latest)
Did you try the Ballerina URL module?
https://lib.ballerina.io/ballerina/url/latest
You can encode/decode urls using this.
yes. check url:decode(value, "UTF-8") only outputs a decoded string, not key/value pairs right?
To do something like, I take it we need to split the decoded string & handle it manually?
let url = new URL('https://example.com?foo=1&bar=2');
let params = new URLSearchParams(url.search);
params.append('foo', 4);
console.log(params.getAll('foo')) //Prints ["1","4"].
Parse, modify and stringify URL query strings