Skip to content

Conversation

@adityasah104
Copy link
Contributor

Description

Clarifies the distinction between 415 and 400 error codes when using request.json, aligning the JavaScript patterns documentation with the API reference.

Changes

  • Updated "Receiving JSON in Views" section to specify:
    • 400 Bad Request: for invalid JSON body
    • 415 Unsupported Media Type: for missing/incorrect Content-Type header
  • Updated "Making a Request with fetch" section for consistency

Fixes

Fixes #5825

Checklist

  • Documentation updated
  • Changes align with existing API documentation

@lonelyH3b

This comment was marked as off-topic.

@davidism

This comment was marked as off-topic.

@lonelyH3b

This comment was marked as off-topic.

@adityasah104

This comment was marked as off-topic.

@adityasah104

This comment was marked as off-topic.

@davidism davidism changed the title docs: clarify 415 vs 400 errors for request.json clarify 415 vs 400 errors for request.json Jan 25, 2026
@davidism davidism added the docs label Jan 25, 2026
Distinguish between 415 Unsupported Media Type (wrong Content-Type)
and 400 Bad Request (invalid JSON body) to align with API documentation.

Fixes #58254
@davidism davidism changed the base branch from main to stable January 25, 2026 02:39
@davidism davidism force-pushed the docs-clarify-json-415-error branch from 973ac59 to 3962683 Compare January 25, 2026 02:39
@davidism davidism closed this Jan 25, 2026
@davidism davidism reopened this Jan 25, 2026
@davidism davidism merged commit 30da640 into pallets:stable Jan 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document 415 on the receiving json section

3 participants