JSON Body Parsing (Express)
JSON body parsing reads a request's JSON payload into req.body. In Express you enable it with the express.json() middleware; without it, req.body is undefined for JSON requests.
Node.js
When a client POSTs JSON, the body arrives as a raw stream of bytes, not a usable object. The express.json() middleware reads that stream, parses the JSON, and assigns the result to req.body, so your route can access req.body.email directly. Register it once with app.use(express.json()) near the top.
It is a frequent beginner trap: forgetting express.json() leaves req.body as undefined, making it look like the client sent nothing. The matching express.urlencoded({ extended: true }) middleware does the same for traditional HTML form submissions (application/x-www-form-urlencoded).
Parsing only applies to requests with a JSON Content-Type, and you can cap the payload size with the limit option to protect against huge bodies. For file uploads (multipart/form-data) you use a different middleware like multer instead.
Syntax
app.use(express.json());Examples
JavaScript
const express = require("express");
const app = express();
app.use(express.json());
app.post("/login", (req, res) => {
const { email } = req.body; // available thanks to express.json()
res.json({ welcomed: email });
});