- Home
- Tools
- Developer Tools
- HTTP Status Codes
- 400 Bad Request
400 Bad Request
The server can't or won't process the request because something is wrong with it: broken syntax, invalid data, a header it can't accept.
- Class
- 4xx Client error. The request is the problem: a wrong address, missing credentials, data the server can't accept.
- Defined in
- RFC 9110
What causes it
For malformed requests: JSON that doesn't parse, a required parameter that is missing, a header that is cut off or too long. It is also the general answer when no more specific 4xx code fits. Web servers send it themselves for requests that break the rules of HTTP, such as plain HTTP sent to an https port.
What to do about it
Don't repeat the request as it is, because it will fail the same way.
In a browser, a 400 on a page that used to work is often caused by a damaged or oversized cookie, and deleting the cookies for that site helps.
As a developer, read the body of the response, where a decent API says what was wrong. If you build the API, say which field is at fault.
Not to be confused with
| 422 Unprocessable Content | The request is well-formed, but its content is not acceptable. |
|---|---|
| 404 Not Found | The address is wrong, not the request. |
| 415 Unsupported Media Type | The format of the body is one the server doesn't take. |
All codes are on the list of HTTP status codes, which can be searched by number and by word.
Other 4xx codes
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 424 Failed Dependency
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons