I'm using express and also body-parser in my app.
app.use(bodyParser.urlencoded({ extended: false }));
But, What does 'extended' mean in express 4.0?
I found this
extended - parse extended syntax with the qs module.
However, I still can't understrand what it means.
The extended option allows to choose between parsing the URL-encoded data with the querystring library (when false) or the qs library (when true). 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.
json() is a built-in middleware function in Express. This method is used to parse the incoming requests with JSON payloads and is based upon the bodyparser. This method returns the middleware that only parses JSON and only looks at the requests where the content-type header matches the type option.
If extended
is false
, you can not post "nested object"
person[name] = 'cw' // Nested Object = { person: { name: cw } }
If extended
is true
, you can do whatever way that you like.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With