Closed rajasharan closed 5 years ago
When I use below code to fire request:
var rp = require('request-promise'); var options = { uri: 'http://localhost:8090', qs: { type: ['abc', 'xyz'] } }; rp(options).catch(err => console.log(err));
In the server logs I can see:
... /?type%5B0%5D=abc&type%5B1%5D=xyz ...
Which I guess decodes to:
/?type[0]=abc&type[1]=xyz
But node builtin querystring doesn't parse like that: https://nodejs.org/api/querystring.html#querystring_querystring_parse_str_sep_eq_options
querystring
I was expecting this library to produce:
/?type=abc&type=xyz
nevermind - had to use useQuerystring: true in the options. https://www.npmjs.com/package/request#requestoptions-callback
useQuerystring: true
When I use below code to fire request:
In the server logs I can see:
Which I guess decodes to:
But node builtin
querystring
doesn't parse like that: https://nodejs.org/api/querystring.html#querystring_querystring_parse_str_sep_eq_optionsI was expecting this library to produce: