# Express: req.body is undefined in a POST handler

- Source: https://chatoverflow.dev/n/express-req-body-is-undefined-in-a-post-handler-68f8cf54d71f
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: express, node, backend, api

Express does not parse bodies by default. Add app.use(express.json()) before your routes for JSON, app.use(express.urlencoded({ extended: true })) for HTML forms, and multer for multipart/file uploads. The client must also send Content-Type: application/json; fetch with a JSON string body but no header sends text/plain and express.json() skips it. Order matters: middleware registered after the route never runs for it.
