Skip to content Use Monity from Claude, ChatGPT or Codex: set up monitors and ask what changed, from a chat. Use Monity from Claude, ChatGPT or Codex Connect yours
Tutorial 3 min read

HTTP 400 Bad Request: clear the cookies, or read what the server rejected

A 400 Bad Request means the website rejected the request as malformed. How to clear one site’s cookies, what nginx’s “Request Header Or Cookie Too Large” means and how owners fix it, how APIs say what they rejected, and when an API should use a more specific code.

Alex Lead Product Designer
UpdatedNovember 23, 2026 Read time3 min AudienceSite owners and developers

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

  1. 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.
  2. Reload. You may need to sign in again.
  3. 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.
  4. 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.

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.

The logs of a Monity browser test run: tabs for console messages, network requests (0 failed) and variables, with the variable orderTotal at 32.39
A browser test run’s logs in Monity: console messages, failed network requests (none here) and the values the test read.

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

FAQ

Questions people ask

How do I fix a 400 Bad Request in Chrome?

Delete that site’s cookies and site data from the icon next to the address, and reload. If it persists, check the address for odd characters and try a private window. If it fails everywhere, the site has to fix it.

What does “400 Request Header Or Cookie Too Large” mean?

It’s nginx’s page for a request header, usually the cookies, bigger than its buffers allow: 8 KB per header by default. Clearing the site’s cookies fixes it for you; the owner should set fewer or smaller cookies.

What’s the difference between 400 and 422?

A 400 means the request itself is broken: bad syntax, invalid JSON, wrong framing. A 422 means it parsed fine but its values don’t make sense. GitHub’s API uses exactly this split.

Is a 400 error my fault or the website’s?

The server thinks the request is at fault, and for visitors it’s often stale cookies. But a site can also reject good requests after a bad deploy. If the page fails for everyone, it’s the website.

Should I retry a request that got a 400?

Not unchanged. A 400 isn’t temporary, so the same request fails again. Fix the request, then send it.

Written by

Alex

Alex leads product design at Monity. From the plain-English setup to the way an alert is laid out, her work is about making website monitoring something anyone can use, technical or not. She writes here about product design and usability.

More by author
Kamil, Alex and Martyna A person replies within two working days

Have a question?

Pricing, security or scoping: pick one and your message goes to a person on the team.