0
const express = require("express");
const bodyParser = require("body-parser");

const app = express();
app.use(bodyParser.urlencoded({extended:true}));


I want to know why we have to set the value of extended to true in the code above for accepting form inputs

  • 1
    Did you look at http://expressjs.com/en/resources/middleware/body-parser.html ? – Anatoly Dec 17 '22 at 11:39
  • You need not set it to `true`, you can also set it to `false`. But you cannot omit it, you must set it to either `true` or `false` is order to document your conscious choice (that's what I think). – Heiko Theißen Dec 17 '22 at 12:24
  • 1
    https://stackoverflow.com/questions/55558402/what-is-the-meaning-of-bodyparser-urlencoded-extended-true-and-bodypar. I think it answers perfectly your question. – Ralle Mc Black Dec 17 '22 at 18:09

0 Answers0