Skip to the content

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

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

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 ContentThe request is well-formed, but its content is not acceptable.
404 Not FoundThe address is wrong, not the request.
415 Unsupported Media TypeThe 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.

See all 12