Skip to content
4xx Client Error

400 Bad Request

The server refuses to process the request because it is malformed.

What causes it

  • Invalid JSON in the body — a trailing comma or a truncated payload.
  • A header that is too large, or contains an illegal character.
  • A query string with an invalid percent-encoding, such as a bare `%`.
  • A missing required parameter, where the API chose 400 over 422.

How to fix it

  • Log the raw body server-side and validate it — most 400s are a serialisation bug on the client.
  • If the request works with curl but not from a browser, compare the exact headers; a stray cookie or oversized `Authorization` header is a common culprit.
  • nginx returns 400 for oversized request headers before your application ever sees them; raise `large_client_header_buffers` if that is the cause.

At a glance

Class
4xx Client Error
Reference
RFC 9110 §15.5.1
Standardised
Yes
Retry the request?
No — fix the request

Other 4xx client error codes

Back to the full HTTP status code reference