DELAPARRA
Index
Color
NL
Category: HTTP status codes

400 Bad Request

Explained by Updated

What is 400 Bad Request?

400 Bad Request: The server could not understand the request because of invalid syntax. 400 Bad Request means the server could not understand the request. The JSON is broken, a required header is missing, or a parameter has the wrong type. It is a client error, so retrying the same request will not help. The client has to fix what it sends. That is why a useful 400 response explains what was wrong, for example "field date must be in YYYY-MM-DD format", rather than just repeating the status text.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about 400 Bad Request

What should you keep in mind with 400 Bad Request?

In practice, APIs use 400 for malformed requests and 422 for requests that are well-formed but fail validation. Laravel, for instance, returns 422 with a list of field errors when validation fails. Whichever you choose, document it and be consistent, so front-end developers can show the right message to the user.

At a glance

CategoryHTTP status codes
Explained by
Updated

More HTTP status codes terms

All terms starting with a number or symbol

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.