Reputation: 87
I was looking for an answer but didn't find proper one. Could you please explain me the difference between omitting the extended option and including it with the value of false? Also why do we have to provide express.urlencoded?Thanks.
app.use(express.urlencoded({extended: false}))
Upvotes: 1
Views: 435
Reputation: 456
There are two main node modules used to parse query strings. Depending on what value you set the extended key (true - default or false), express will use that corresponding library.
The “extended” syntax allows for rich objects and arrays to be encoded into the URL-encoded format, allowing for a JSON-like experience with URL-encoded.
The difference between the two are very minuscule and you shouldn't worry too much about it because they do the same thing. It's just a matter of the different syntax being used.
Upvotes: 4