Middle
What is the difference between HTTP status codes 400, 500, and 200?
sobes.tech AI
Answer from AI
HTTP status 200 means that the request was successfully processed, and the server returned the expected result.
Status 400 is a client error (Bad Request). It occurs when the request is incorrect, for example, missing required parameters or incorrect data format.
Status 500 is a server error (Internal Server Error). It indicates that an unexpected error occurred on the server while processing the request.
Example:
- The client sent a correct request — the server responds with 200.
- The client sent a request with invalid JSON — the server responds with 400.
- A failure occurred in the database during request processing — the server responds with 500.