HTTP 400 Bad Request
The request was malformed or invalid. The server cannot process it.
Bad Request
The request was malformed or invalid. The server cannot process it.
What Causes HTTP 400?
- Malformed JSON or XML in request body
- Missing required fields or parameters
- Invalid data types or format
- Request exceeds size limits
- Invalid query parameters
Code Examples
See how HTTP 400 responses look in different programming languages and tools.
curl -X POST https://api.example.com/users \
-H "Content-Type: application/json" \
-d 'invalid json'
# Response: 400 Bad RequestHow to Fix HTTP 400
- Check the request body format and syntax
- Validate all required fields are present and correct
- Review API documentation for correct request format
- Ensure JSON/XML is properly escaped and formatted
- Check for size limits on request payload
Related Status Codes
Authentication is required. The client must provide valid credentials.
The server understood the request but refuses to authorize it. Authentication won't help.
The requested resource could not be found on the server.
Rate limit exceeded. The client has sent too many requests in a given time period.
The server encountered an unexpected condition that prevented it from fulfilling the request.
Test Your APIs
Frequently Asked Questions
What does HTTP 400 mean?
The request was malformed or invalid. The server cannot process it.
What causes HTTP 400?
Malformed JSON or XML in request body. Missing required fields or parameters. Invalid data types or format. Request exceeds size limits. Invalid query parameters
How to fix HTTP 400?
Check the request body format and syntax. Validate all required fields are present and correct. Review API documentation for correct request format. Ensure JSON/XML is properly escaped and formatted. Check for size limits on request payload