Skip to content

HTTP status 422 should (IMHO) be "Unprocessable Content" not "Unprocessable Entity" #59789

@hacklschorsch

Description

@hacklschorsch

I am trying to write a spec-conforming microservice. The spec requires that I return HTTP 422 (Unprocessable Content) in a specific situation:

https://www.rfc-editor.org/rfc/rfc9578.txt

If any of these conditions are not met, the Issuer MUST return an HTTP 422 (Unprocessable Content) error to the Client.

But when I return a 422, node.js attaches Unprocessable Entity instead.

422: 'Unprocessable Entity', // RFC 4918 11.2

This issue for the (unrelated) Rust hyperium HTTP library explains it better than I can: hyperium/http#664

Both of the following RFCs define 422 but with a one-word difference:

  • RFC 4918, "Proposed Standard", June 2007, "Unprocessable Entity"
  • RFC 9110, "Internet Standard", June 2022, "Unprocessable Content"

Arguments in Favor of RFC 9110

  • RFC 9110 is titled "HTTP Semantics" which is a direct fit for this library, whereas RFC 4918 is scoped to WebDAV.
  • RFC 9110 is an Internet Standard while RFC 4918 is only a Proposed Standard.
  • MDN uses RFC 9110 for the 422 status code
  • RFC 9110 is newer (2022 vs. 2007)

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions