HTTP status code, which is currently used. I used to remember several common status codes, such as 200,302,304,404,503. Generally, I only need to know these common status codes. For AJAX, REST, web crawler, robot and other programs. You still need to know other status codes. In this article, I spent more than a month summing up all the status codes. The content is too much, so I have to be patient.
The learning materials for HTTP status codes are everywhere, but they are all explained theoretically. This article describes the HTTP Status Code in the HTTP protocol and provides detailed examples of most Status codes.
To understand the status code, you should understand the meaning of the status code in the instance, otherwise you will forget it.
Code description for http status return
100 (continue) the requester shall continue to make the request. The server returns this code, indicating that the first part of the request has been received and is waiting for the remaining part.
101 (switching protocol) the requester has requested the server switching protocol. The server has confirmed and is ready to switch.
Return code 2xx for http status (successful)
Indicates that the request status code is successfully processed.
Code description for http status return
200 (successful) the server has successfully processed the request. Generally, this indicates that the server provides the requested webpage.
The 201 (created) request is successful and the server creates a new resource.
202 (accepted) the server has accepted the request but has not yet processed it.
203 (unauthorized information) the server has successfully processed the request, but the returned information may come from another source.
204 (no content) the server successfully processed the request, but did not return any content.
205 (reset content) the server successfully processed the request, but did not return any content.
206 (partial content) the server successfully processes some GET requests.
Code 3xx returned for http status (redirection)
Indicates that further operations are required to complete the request. These status codes are usually used for redirection.
Code description for http status return
300 (multiple options) for requests, the server can perform multiple operations. The server selects an operation based on the user agent or provides an Operation list for the user agent to select.
The webpage of the 301 (permanent mobile) request has been permanently moved to a new location. When the server returns this response (response to a GET or HEAD request), it automatically redirects the requester to a new location.
The 302 (temporary mobile) server currently responds to requests from different locations, but the requester should continue to use the original location for subsequent requests.
303 (view other locations) when the requester uses a separate GET request for different locations to retrieve the response, the server returns this code.
304 (not modified) the requested webpage has not been modified since the last request. When the server returns this response, no webpage content is returned.
305 (using a proxy) the requester can only use a proxy to access the requested webpage. If the server returns this response, it also indicates that the requester should use a proxy.
307 (temporary redirection) the server currently responds to requests from different locations, but the requester should continue to use the original location for subsequent requests.
Code 4xx returned for http status (request error)
These status codes indicate that the request may fail and impede server processing.
Code description for http status return
400 (incorrect request) the server does not understand the request syntax.
401 (unauthorized) requests require authentication. The server may return this response for webpages that require logon.
403 (forbidden) the server rejects the request.
404 (not found) the server cannot find the requested webpage.
405 (method disabled) disable the method specified in the request.
406 (unacceptable) unable to respond to the requested webpage using the requested content features.
407 (proxy authorization required) This status code is similar to 401 (unauthorized), but the specified requester should authorize the use of proxy.
408 (Request Timeout) timeout occurred when the server waited for the request.
409 conflict occurs when the server completes the request. The server must contain conflict information in the response.
410 (deleted) if the requested resource has been permanently deleted, the server returns this response.
The 411 (valid length required) server does not accept requests that do not contain valid content length header fields.
412 (not meeting the prerequisites) the server does not meet one of the prerequisites set by the requester in the request.
413 (the request entity is too large) the server cannot process the request because the request entity is too large and exceeds the server's processing capability.
414 (the requested URI is too long) the request URI (usually the URL) is too long and cannot be processed by the server.
415 (Unsupported media type) The request format is not supported by the request page.
416 (the request range does not meet the requirements) if the page cannot provide the request range, the server returns This status code.
417 (not meeting expectations) the server does not meet the "expectation" request header field requirements.
Http status return code 5xx (server error)
These status codes indicate an internal error occurred when the server attempted to process the request. These errors may be server errors rather than request errors.
Code description for http status return
500 (Internal Server Error) the server encounters an error and cannot complete the request.
501 (not implemented) the server does not have the function to complete the request. For example, this code may be returned when the server cannot identify the request method.
The 502 (error gateway) server acts as a gateway or proxy and receives an invalid response from the upstream server.
503 (service unavailable) servers are currently unavailable (due to overload or downtime maintenance ). Generally, this is only a temporary status.
504 (gateway timeout) the server acts as a gateway or proxy, but does not receive a request from the upstream server in time.
505 (HTTP version not supported) the server does not support the HTTP protocol version used in the request.
Some common http status return codes are as follows:
200-the server returns the webpage successfully
404-the requested webpage does not exist
503-service unavailable