Skip to content

4xx Client errors

400 Bad Request

The server could not understand the request: broken syntax, invalid JSON, or headers or cookies that are too large.

Common causes

  • Malformed JSON in an API request.
  • Cookies or headers too large ("Request Header Or Cookie Too Large").
  • A request blocked by a WAF rule that answers 400.

How to fix a 400 error

  1. 1

    Validate the JSON you send (the JSON formatter tool shows the exact error position).

  2. 2

    Clear the site's cookies in the browser and try again.

  3. 3

    Check the server error log for the rule or reason.

In Laravel

Invalid JSON bodies arrive as an empty request in Laravel; validation errors are 422, not 400.

Check the status of a URL

The first line of the response shows the status code; -L follows redirects and shows each step.

curl -I https://example.com/page
curl -IL https://example.com/old-page

Frequently asked questions

What does HTTP 400 mean?

The server could not understand the request: broken syntax, invalid JSON, or headers or cookies that are too large.

How do I fix a 400 error?

Validate the JSON you send (the JSON formatter tool shows the exact error position). Clear the site's cookies in the browser and try again. Check the server error log for the rule or reason.

How does Laravel handle 400?

Invalid JSON bodies arrive as an empty request in Laravel; validation errors are 422, not 400.

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.