client error RFC 9110
HTTP 400 Bad Request
Server cannot process the request due to a client-side error — malformed syntax, invalid JSON, missing required fields.
What it means
The generic 'the request itself is broken' code. Something about the syntax, formatting, or content of the request means the server can't even try to fulfill it. This is different from 422 (Unprocessable Entity) — 400 means "I can't parse this" while 422 means "I parsed it but the values are invalid."
When servers send it
- •Malformed JSON in request body
- •Missing required query parameters
- •Invalid Content-Type for the endpoint
- •Request headers exceed size limits
- •Malformed URL (invalid characters, over-long)
What the client does
Should NOT retry the same request — it will fail again. Fix the request and try again.
Common causes
- •Client sent invalid JSON (trailing comma, unescaped quotes)
- •Required field missing from the request body
- •Query parameter has wrong type (`?limit=abc` where number expected)
- •Body sent but Content-Type header missing or wrong
- •CORS preflight rejected (though usually returns 403 or a specific CORS error)
How to fix it
- 1.Check the response body — most APIs include a JSON error with details about what failed
- 2.Validate the request body as JSON before sending (use a JSON linter)
- 3.Verify Content-Type matches what you're actually sending
- 4.Check that all required fields are present (see the API docs)
- 5.Log the exact bytes being sent — the issue is often invisible whitespace or BOM
Similar codes
401 Unauthorized client error
Authentication is required and either missing or invalid — the client is not identified.
403 Forbidden client error
Server understood who you are but refuses to authorize the request — permission denied.
404 Not Found client error
The requested URL does not exist on this server.
422 Unprocessable Entity client error
Request is syntactically valid but the data inside it is invalid — validation failed.
405 Method Not Allowed client error
The URL exists but doesn't support the HTTP method the client used.
← All HTTP status codes · HTTP status cheat sheet · HTTP headers reference