Error: too many parameters
at queryparse (/project/node_modules/body-parser/lib/types/urlencoded.js:120:17)
at parse (/project/node_modules/body-parser/lib/types/urlencoded.js:64:9)
This is due to the fact the urlencode defaults to 1000 parameters by default. If you have a large form or just an abnormally large JSON submission, you'll need to increase this limit by doing the following:
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({
extended: false,
parameterLimit: 10000,
limit: 1024 * 1024 * 10
}));
app.use(bodyParser.json({
extended: false,
parameterLimit: 10000,
limit: 1024 * 1024 * 10
}));
This will allow you to provide up to 10,000 parameters (increase as needed) and 10 MB of data (also adjustable).
This worked for me. Thanks! I left the extended property as true. Could this have any negative side effects?
ReplyDeleteThanks Admin, I just begin my career in sever side web application development for that I complete the Node JS training but I wish to explore more in that, truly your blog provide some useful information and I would like to share your blog in my friends circle so keep sharing.
ReplyDeleteRegards,
Node JS training in chennai