Skip to content

400 Bad Request (HTTP Status Code 400)

Updated: at 09:12 AM

HTTP status code 400 indicates that the server cannot understand the client’s request due to incorrect request syntax. This is a client error status code, typically occurring in the following situations:

When the server returns a 400 status code, it indicates that there is a problem with the request sent by the client, which needs to be corrected and resubmitted. The server may also provide error details to help developers diagnose the issue.

For example, if a client sends an HTTP request but the format of the request line or headers is incorrect, the server might return the following response:

HTTP/1.1 400 Bad Request
Content-Type: text/html
Content-Length: 160

<html>
<head><title>Bad Request</title></head>
<body>
<h1>Error: 400 Bad Request</h1>
<p>Your browser sent a request that this server could not understand.</p>
</body>
</html>

In this example, the status code 400 indicates that the server cannot understand the request, and the response body contains a simple HTML page describing the error information.

When client developers encounter a 400 error, they should check the request’s syntax, parameters, header fields, and body content to ensure they comply with HTTP standards and the server’s requirements.