Skip to content
Yeabsira on GitHub Yeabsira on Twitter

Status Code and Error

When a client sends a request to a server, the server sends a response back to the client. This response includes two important pieces of information: a statusCode and an Error.

For example, if a client sends a request to a server to retrieve a web page that does not exist, the server will respond with a 404 status code, indicating that the requested resource was not found.

For example, if a client sends an invalid input to a server, the server might respond with a 400 status code (indicating a client error) and an error message in the response body explaining the specific problem with the input.

In summary, the statusCode is a standardized code that provides a high-level status of the response, while the Error provides more specific information about the reason for the failure. Both pieces of information are important for understanding the server’s response to a client request.