For:
bodyParser.urlencoded({extended: ...})
my research shows me that if extended: true
, then you can parse nested objects, or generally any type. However, if you set extended: false
, then you can only parse strings or arrays. But what does ...
app.use(bodyParser.json())
mean exactly? I mean, yes... I know the docs mention that it parses json. But I am still confused. I have noticed applications that set extended: true
do NOT use bodyParser.json()
at all. But applications that extended: false
tend to use bodyParser.json()
. Why is this? At the end of the day, both applications are able to parse json.
Secondly, which is the recommended approach?
app.use(bodyParse.json())
? Or does the latter always go with extended being false? But interestingly, both seem to work for json parsing. – Tound