@http · HTTP status codes, explained HTTP/1.1 400 Bad Request ━━━━━━━━━━━━━━━━━━━━━━━━ 4xx · Client error The server can't parse or won't accept the request. WHAT IT MEANS ──────────────────────────────────────────────────────────── The server can't or won't process the request because of something it sees as a client error: malformed syntax, an invalid message frame, or a request that breaks the API's rules. It's the catch-all client error. When a more specific code fits, such as 401, 404, 413, 415 or 422, use that instead. WHY YOU'RE SEEING IT ───────────────────────────────────────────────────── → Invalid JSON, or a body that doesn't match its Content-Type. → Missing or malformed required parameters. → Bad characters in the URL, or a malformed header. → Oversized or corrupted cookies; nginx reports these as 400. HOW TO FIX IT ──────────────────────────────────────────────────────────── → Return an error body that says exactly which field is wrong and why. → On the client, validate the payload and check headers and URL encoding. → If only one browser fails, clear the site's cookies. EXAMPLE RESPONSE ───────────────────────────────────────────────────────── HTTP/1.1 400 Bad Request Content-Type: application/problem+json  {"title": "Invalid JSON", "detail": "Unexpected token at position 18"} related 422 Unprocessable Content   415 Unsupported Media Type   413 Content Too Large spec RFC 9110 §15.5.1 https://www.rfc-editor.org/rfc/rfc9110#section-15.5.1 web https://athttp.com/400 ← curl athttp.com/308 curl athttp.com/401 →