4xx Client Errors

HTTP 422 Unprocessable Content

The request was well-formed but semantically erroneous (WebDAV / RFC 4918).

When is 422 used?

  • Validation errors on form fields
  • Semantically invalid request data

How to handle a 422 response

Inspect the request — URL, method, headers, credentials, and body. Retrying the same request unchanged will usually fail again; 429 is the exception, where you should wait for the Retry-After period.

Check the status code a URL returns from the command line:

curl -s -o /dev/null -w "%{http_code}\n" https://example.com

How to return 422 from your server

Node.js (Express)

res.status(422).json({ message: 'Unprocessable Content' });

Python (Flask)

return {"message": "Unprocessable Content"}, 422

Go (net/http)

w.WriteHeader(422)

Frequently Asked Questions

What does HTTP 422 mean?

422 Unprocessable Content: The request was well-formed but semantically erroneous (WebDAV / RFC 4918).

Is 422 an error?

Yes. 422 is in the 4xx Client Errors class. Client errors: the request is malformed, unauthorized, or targets something that does not exist.