When we request data from the server, the server will give us a feedback, tell us how to treat our request, the server processing how, and this feedback is transmitted by the number, this number is called the status code.
The status code is divided into the following types:
- 1XX: Indicates that the request has been received and continues processing.
- 2XX: Success-Indicates that the request has been successfully received, understood, accepted.
- 3XX: Redirect--further action is required to complete the request.
- 4XX: Client Error--the request has a syntax error or the request is not implemented.
- 5XX: Server-side error-the server failed to implement a legitimate request.
A description of the common status code and status is described below.
- OK: Client request succeeded.
- Bad Request: Client requests have syntax errors and cannot be understood by the server.
- 401 Unauthorized: Request is not authorized, this status code must be used with the Www-authenticate header domain.
- 403 Forbidden: The server receives the request but refuses to provide the service.
- 404 Not Found: The request resource does not exist, for example: The wrong URL was entered.
- Internal Server error: Unexpected errors occurred on the server.
- 503 Server Unavailable: The server is currently unable to process client requests and may return to normal after some time.
Three ways to fix the "status code" of the HTTP protocol