Parse numbers from query strings with bodyParser.urlencoded() in express.js
问题 In the front end, I use jQuery to send a GET request like this: $.get('/api', {foo:123, bar:'123'), callback); according to jQuery doc, the 2nd parameter is a plain object that will be converted into query string of the GET request. In my node express back end, I use body-parser like this: const bodyParser = require("body-parser"); app.use(bodyParser.urlencoded({ extended: true })); app.get('/api', (req, res) => { console.log(req.query) // req.query should be the {foo:123, bar:'123'} I sent }