Back to all status codes
400

Bad Request

The server cannot process the request due to malformed syntax or invalid request message framing.

Common Causes

  • Malformed JSON in request body
  • Invalid query parameters
  • Missing required fields
  • Invalid character encoding

Fix Solutions

Validate request body

Ensure JSON is properly formatted and all required fields are present.

Check Content-Type header

Make sure Content-Type matches the request body format.

Code Examples

# Custom 400 error page
error_page 400 /400.html;

Related Tools