Body-parser is a middleware in Node.js that parses incoming request bodies in a middleware before your handlers, making it accessible under the req.body
property. It supports various content types, including JSON, URL-encoded data, and raw text. It is commonly used with Express.js to handle form submissions and JSON data in web applications. As of Express 4.16.0, body-parser functionality is built into Express itself, allowing developers to use express.json()
and express.urlencoded()
directly.