Skip to content

docs: clarify express.json() parses bodies regardless of HTTP method#2439

Open
bkmaxbaibhav wants to merge 1 commit into
expressjs:mainfrom
bkmaxbaibhav:docs/body-parsing-method-note
Open

docs: clarify express.json() parses bodies regardless of HTTP method#2439
bkmaxbaibhav wants to merge 1 commit into
expressjs:mainfrom
bkmaxbaibhav:docs/body-parsing-method-note

Conversation

@bkmaxbaibhav

Copy link
Copy Markdown

Summary

This is a documentation-only clarification — no code or tests were changed.

Body-parsing middleware such as express.json() is not gated by HTTP method: it will attempt to read and parse a request body on any method, including GET, HEAD, and DELETE requests that conventionally carry no body. Developers who apply body-parsing middleware globally via app.use() may not be aware of this, which can affect how they reason about middleware ordering.

Changes

Added an informational note to the express.json() section in both the 4.x and 5.x API reference pages advising developers to:

  • Register rate-limiting or request-size-limiting middleware before body-parsing middleware in the chain.
  • Apply body-parsing only to routes that expect a request body where possible.

Scope

  • Documentation text only, in src/content/api/4x/api/express/index.mdx and src/content/api/5x/api/express/index.mdx
  • No behavior changes, no new tests, no dependency changes.

@bkmaxbaibhav bkmaxbaibhav requested a review from a team as a code owner July 8, 2026 19:02
@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 3f370c9
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/6a4e9eb1e8b8b300089aac45
😎 Deploy Preview https://deploy-preview-2439--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (🟢 up 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant