Express Post JSON Flashcards

1
Q

What does the express.json() middleware do and when would you need it?

A

It parses incoming requests with JSON payloads and is based on body-parser.

Returns middleware that only parses JSON and only looks at requests where the Content-Type header matches the type option. This parser accepts any Unicode encoding of the body and supports automatic inflation of gzip and deflate encodings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly