400
MediumWeb Server

Bad Request — the server cannot process the request because it is malformed

What 400 Means

The 400 error on the HTTP Status-Codes indicates bad request — the server cannot process the request because it is malformed. This typically occurs due to malformed request syntax or invalid body encoding.

A 400 Bad Request indicates that the server rejected the request because its syntax, framing, or structure was invalid. It belongs to the 4xx class, which points to a problem with the request sent by the client rather than a server-side failure. Many servers emit 400 before application code runs, especially when headers, body encoding, or URL formatting cannot be parsed into a valid request.

Technical Background

A 400 response is the generic HTTP signal that the server rejected the request before normal processing could continue. It usually points to invalid syntax, malformed framing, or input the server cannot parse into a valid request object.

Many frameworks also use 400 for failed validation when no more specific status code is configured. That makes 400 broader than 422, which is usually reserved for payloads that are structurally valid but semantically unacceptable to the application.

Common Causes

  • Malformed request syntax or invalid body encoding
  • Missing required headers or incorrect Content-Length
  • Corrupted query string or unsupported character encoding
  • Request body does not match the declared format

Typical Scenarios

  • A client sends malformed JSON with a content type that claims the body is valid JSON
  • A proxy forwards a request with a broken Content-Length header
  • A URL contains invalid characters that the server refuses to parse

What to Know

A 400 is usually tied to the specific request that triggered it rather than to the entire site. If many unrelated requests start returning 400 at once, the common cause is often a proxy, client library, or encoding issue instead of a missing page or application crash.

Frequently Asked Questions

Common questions about HTTP 400 error

A 400 response usually points to malformed request syntax, invalid encoding, broken headers, or a request body the server cannot parse into a valid format.

It is a client-side request error in the HTTP model. The server is reachable and responding, but it is rejecting the specific request it received.

A 400 error usually means the server could not parse the request correctly at all. A 422 means the request format was valid, but the content still violated application rules or validation logic.

Related Error Codes