How do I send a request with superagent that uses the same query parameter
You definitely will not see all three q
values when you pass the query in the manner you are trying, because you are making a JavaScript object there and yes, there will only be one q
value:
$ node
> {q:'help',q:'moreHelp',q:'evenMoreHelp'}
{ q: 'evenMoreHelp' }
Superagent allows query strings, as in this example straight from the docs:
request
.get('/querystring')
.query('search=Manny&range=1..5')
.end(function(res){
});
So if you pass the string 'q=help&q=moreHelp&q=evenMoreHelp'
you should be okay. Something like:
req.get('website.com').query('q=help&q=moreHelp&q=evenMoreHelp').end(...)
If this is too ugly, you can try (WARNING: I have not tried this):
req.get('website.com')
.query({ q: 'help' })
.query({ q: 'moreHelp' })
.query({ q: 'evenMoreHelp' })
.end(...);