Closed pawelusfr closed 4 years ago
return retryWithMergedOptions(updatedOptions);
You need to pass the search string in a URL:
require('got').get('https://httpbin.org/anything?users=a,b,c').json();
That's because the search string doesn't have to be a query string.
Describe the bug
I need to send a query parameter that is an array in comma separated format e.g.
htts://someurl.com?users=user1,user2
In got 9.6.0 it was possible usingquery-string
module as described in documentation In got 11.5.1 that part of documentation aboutquery-string
is gone and got will url escape thesearchParams
no matter what I try (query-string or URLSearchParams)Actual behavior
got url escapes searchParams and will send the request to
http://someurl.com?users=user1%2Cuser2
Expected behavior
got should not escape searchParams and send the request to
htts://someurl.com?users=user1,user2
Code to reproduce
Checklist