~/devtools / http-status / 400
tool::http-status-detail

400 Bad Request

The server could not understand the request due to invalid syntax.

ad · 728×90
Status Code
400
Name
Bad Request
Category
4xx

Detailed Explanation

HTTP 400 Bad Request indicates that the server cannot understand the client's request or that the request contains malformed syntax. This is typically a client-side issue, and the same result will be returned unless the request is corrected. It is the most commonly used error code when input validation fails in API development.

Common Causes
  • Syntax errors in the JSON request body (missing brackets, incorrect quotes, etc.)
  • Missing required parameters or values of the wrong type
  • Improperly URL-encoded query strings
  • Mismatch between the Content-Type header and the actual body format
  • Request size exceeding the server's configured limit
How to Fix
  • 1.Validate the JSON syntax of the request body (using jsonlint, etc.)
  • 2.Check the API documentation to match required parameters and types
  • 3.Ensure the Content-Type header is correct (e.g., application/json)
  • 4.Verify that special characters in the URL are properly encoded
  • 5.Check server logs to identify the specific validation failure

Related HTTP Headers

Content-TypeContent-Length

Response Example

HTTP/1.1 400 Bad Request
Content-Type: application/json

{"error":"validation_failed","message":"'email' field is required"}

Related Status Codes

401UnauthorizedAuthentication is required and has failed or not been provided.402Payment RequiredReserved for future use; some services use it for payment walls.403ForbiddenThe server refuses to fulfill the request (authenticated but unauthorized).404Not FoundThe requested resource could not be found.405Method Not AllowedThe HTTP method is not supported for this resource.
ad · 300×250
Back to all status codes
// related tools
Cron Expression Generator
Build and parse cron expressions visually. Generate human-readable descriptions and preview next execution times.
jwt
JWT Decoder
Decode and inspect JWT tokens. View header, payload, and signature details.
rx
Regex Tester
Test regular expressions with live matching, group highlighting, and explanations.
Color Converter
Convert colors between HEX, RGB, HSL, and more. Pick colors visually.