##what will happen if i dont add this line to my express code.
app.use(bodyParser.urlencoded({ extended: true }));
##what will happen if i dont add this line to my express code.
app.use(bodyParser.urlencoded({ extended: true }));
It supports parsing of application/x-www-form-urlencoded
post data
If you don't add this line you won't be able to parse the body of requests with application/x-www-form-urlencoded
content type
Essentially, this lets you interact with forms sent with the application/x-www-form-urlencoded
content-type much easier within express.
You can simply use the req.body.ELEMENT_NAME with these types of forms. This allows for interaction with more modern browsers that use this content-type when submitting a form. It is extremely beneficial for compatibility and I would recommend using it.