400 Bad Request
The server could not understand the request
Seen in Browsers, APIs, web servers
The server rejected the request as malformed before trying to process it.
Common causes
- A JSON or form body that is invalid, or sent with the wrong Content-Type.
- Missing or invalid required parameters in an API call.
- Oversized or corrupted cookies or headers.
- Illegal characters in the URL, often from a value that was not URL-encoded.
How to fix it
- Read the response body: most APIs say which field or header is wrong.
- Check the Content-Type matches the body and the body parses (e.g. pipe it through jq).
- URL-encode query values and clear the site's cookies if only one browser is affected.
Got a different message? Paste it into the error explainer.
Related errors
- 502 Bad Gateway · The proxy got a bad response from the server behind it
- 504 Gateway Timeout · The server behind the proxy took too long
- Error 520: Web server is returning an unknown error · Cloudflare got an empty or invalid response
- 429 Too Many Requests · You've hit a rate limit
- 401 Unauthorized · The request needs valid credentials
- 403 Forbidden · The server refuses to allow this request
- 404 Not Found · Nothing exists at this URL
- 405 Method Not Allowed · This URL does not accept that HTTP method
- 410 Gone · The resource was removed on purpose
- 414 Request-URI Too Large · The URL is longer than the server accepts
- 500 Internal Server Error · The application hit an error it did not handle
- 400 Bad Request: The plain HTTP request was sent to HTTPS port · Plain HTTP was sent to a port that expects TLS