Express does not return all query string parameters Express does not return all query string parameters express express

Express does not return all query string parameters


If you are using curl or some terminal command, & has a special meaning there. Try gettig it inside quotes as

curl 'http://localhost/pdf/123?option=456&clientId=789'


This code is working:

app.get('/pdf/:id', function(req, res) {    console.log(req.params);    console.log(req.query);    res.end();});

Output:

[ id: '123' ]{ option: '456', clientId: '789' }GET /pdf/123?option=456&clientId=789 200 1ms