A 400 Bad Request means the website rejected your request as malformed. In a browser, the usual cause is the site’s cookies grown too large or broken, or a mistyped address. Clear that one site’s cookies and reload. If you’re calling an API, the response body says which part of the request it didn’t accept.
In your browser: clear that site’s cookies
- Open the site’s settings from the icon to the left of the address bar, and delete its cookies and site data. That removes only that site’s cookies, not every site’s.
- Reload. You may need to sign in again.
- Still 400? Check the address for a stray
%, a space or odd characters at the end, and try a private window, which starts with no cookies or extensions. - Only when you upload or send a form? Try a smaller file or another browser. If nothing works, the site is rejecting something it shouldn’t, and only its owner can fix it.
Reloading alone won’t change anything: MDN notes that the same request fails the same way.
“400 Request Header Or Cookie Too Large”
That page is nginx’s. It answers 400 when one request header doesn’t fit its large_client_header_buffers, 8 KB each by default, and the header that grows is nearly always Cookie. AWS’s Application Load Balancer has its own limits: 16 KB for one header line, 64 KB for all of them (AWS).
If it’s your site, find what sets the biggest cookies (analytics tags, a single sign-on token, a cart stored whole in a cookie) and shrink or expire them. Raising the buffer buys time but doesn’t stop the growth:
large_client_header_buffers 4 16k;
In an API: the body tells you what’s wrong
RFC 9110 calls 400 the code for “something that is perceived to be a client error”, such as malformed syntax or framing. APIs use it for different things, and most say which in the body:
| Where | When it answers 400 |
|---|---|
| GitHub’s API | Invalid JSON (“Problems parsing JSON”) or an unsupported API version; well-formed JSON with wrong values gets 422 |
| Stripe’s API | “Often due to missing a required parameter” |
| OAuth token requests (RFC 6750) | A missing or repeated parameter: invalid_request |
| Cloudflare (docs) | Bad percent-encoding in the address, or a request with both Content-Length and Transfer-Encoding: chunked |
Look at the request as it was sent, not as you meant it. curl -v prints every header, so a wrong Content-Type or a body that isn’t JSON shows at once:
curl -v -X POST https://api.example.com/orders \
-H "Content-Type: application/json" \
-d '{"sku": "A-100", "qty": 2}'
Designing an API: 400 or a more specific code?
A client can act on a specific code without parsing your message. Keep 400 for requests you can’t parse, and use the others where they fit:
- 401 for missing or invalid credentials;
- 413 for a body over your size limit;
- 422 for a body that parses but fails validation;
- 431 for headers that are too large.
When a form or a checkout calls an API that starts rejecting good requests after a deploy, a browser test in Monity notices: each run keeps the requests that failed.

More: 422 Unprocessable Content, 401 Unauthorized and all HTTP status codes.