Status code
- 1×× : indicates that the protocol processing is in the intermediate state and subsequent operations are required.
- 2 x x: Indicates that the packet is received and correctly processed.
- 3×× : indicates redirection. The resource location changes and the client needs to resend the request.
- 4 x x: The client is incorrect and the server cannot process the request packet.
- 5×× : Server error. The server has an internal error while processing the request.
2XX
2 x x class status code Indicates that the server receives and successfully processes the client request
200 OK
Is the most common success status code, indicating that everything is fine and that the server has returned the processing as expected by the client. If the request is not HEAD, there will usually be body data after the response header.
204 No Content
Is another very common success status code, which means basically the same as “200 OK,” but has no body data after the response header. So it is necessary for the Web server to correctly distinguish between 200 and 204.
206 Partial Content
It is the basis of HTTP block download or breakpoint continuation, when the client sends a “range request”, asking for part of the resource data, it is the same as 200, the server successfully processed the request, but the data in the body is not all of the resource, but a part of it.
3XX
301 Moved Permanently
It is commonly known as “permanent redirect”, meaning that the requested resource no longer exists and needs to be accessed again with a new URI.
302 Found
Commonly known as temporary redirection, this means that the requested resource is still available, but temporarily needs to be accessed using another URI
304 Not Modified
The requested page has not changed since the last request. When the server returns this response, the web page content is not returned.
If the web page has not changed Since the requestor last requested it, you should configure the server to return this response (called the IF-modified-since HTTP header). The server can tell Googlebot that the page hasn’t changed since the last grab, saving bandwidth and overhead.
4XX
400 Bad Request
Is a general error code indicating that there is something wrong with the request packet, but whether it is a bad data format, a missing request header, or an excessively long URI, it is not explicitly stated. It is just a general error. Therefore, when developing Web applications, you should try to avoid returning 400 to the client, and use other status codes with more specific meaning.
403 Forbidden
Rather, it means that the server has forbidden access to the resource.
404 Not Found
The idea is that the resource is not found on this server, so it cannot be made available to the client.
5XX
500 Internal Server Error
A generic error code. We don’t know what happened to the server.
501 Not Implemented,
The ability to represent client requests is not yet supported.
502 Bad Gateway
The error code is usually returned when the server acts as a gateway or proxy. It indicates that the server itself works properly but an error occurs when accessing the back-end server. However, the specific cause of the error is unknown
503 Service Unavailable
Indicates that the server is busy and cannot respond to services. 503 response packets also typically have a “retry-After” field that indicates how long the client can Retry sending the request.
reference
- How to use the response status code?