400 Bad Request
The request itself is malformed. If it parsed but fails your rules, 422 is often more precise.
400Client error
- What it means
- The request itself is malformed. If it parsed but fails your rules, 422 is often more precise.
- In practice
- 400 means the server could not make sense of the request at all: broken JSON, a missing required header, a malformed URL. Compare 422, where the request parsed fine but failed validation. As a client, print the response body — well-behaved APIs say which part was malformed. As a server, be specific in that body; a bare 400 sends people straight to your support inbox.
- Whose problem is it?
- The request. Retrying it unchanged will get the same answer.
Often confused with