Write in front:

When a visitor visits a web page, the visitor’s browser makes a request to the server where the page is located. When the browser receives and displays a web page, the server on which the web page is located returns a header containing an HTTP status code in response to the browser’s request. This article is mainly: about HTTP status code is what, what use, where to view the status code respectively represent what the meaning of the share, which is very much content, so in this popular science, do wave share. There are key word versions and detailed versions of each error.


What is the use of HTTP status codes?

At its core, HTTP status codes are used by the Web Server to tell the client what happened to the current Web request, or the status of the current Web Server response. Therefore, HTTP status codes are often used to determine and analyze the health of the current Web server.

We, as programmers, need to know as much as possible about these status codes, and figure out these status codes one by one, so that when we encounter problems in our work, we can understand where the problems are and solve them accordingly.

Common HTTP status codes:

200 OK server successfully processed the request (this is the one we see most)

301/302 Moved Permanently (Redirection) The requested URL has been Moved. The Response should contain a Location URL that indicates where the resource is now located

404 Not Found The resource

501 Internal Server Error The Server encountered an Error that prevented it from servicing the request

Summary of common HTTP status codes (described in detail below) :

Beginning 1 :(accepted, need to continue processing.) This type of status code indicates that the request has been accepted and needs to continue processing. This type of response is a temporary response, containing only the status line and some optional response header information, and ending with an empty line.

2 Start (Request successful) This type of status code indicates that the request has been successfully received, understood, and accepted by the server

This type of status code indicates that the client needs to take further action to complete the request. Typically, these status codes are used for redirection, and subsequent request addresses (redirect targets) are specified in the Location field of this response.

4 :(request error) this type of status code indicates that the client appears to have an error that interferes with the server’s processing. Unless responding to a HEAD request, the server should return an entity that explains the current error condition and whether it is temporary or permanent. These status codes apply to any request method. The browser should show the user any entity content contained in such an error response.

5 :(server error) this type of status code indicates that the server is processing the request in an error or exception state, or the server may realize that the current hardware and software resources cannot complete the request processing. Unless this is a HEAD request, the server should contain an explanation entity that explains the current error state and whether the state is temporary or permanent. The browser should show the user any entities that are included in the current response.


Where can I view the HTTP status code?

1. Debug F12 in the browser (or right-click to check) and check Status on network, as shown in the figure below. Status is the Status code returned by HTTP.

2. Various online input URL query HTTP status tools:

Such as: stand long HTTP status query: tool.chinaz.com/pagestatus/

Sites like this also offer this feature… www.3464.com/Tools/PageS…

Other should still have a lot of, can oneself search.

Status code change conversion:

When making an HTTP request, we see only the status code returned by the server, such as 404 error, or 200 success. Does this mean that during the entire HTTP status request, the status code is only the one returned at the end?

In fact, the HTTP status code changes very quickly during the request, like the status code starting with 1 (accepted, need to continue processing). This type of status code is only a temporary response status code, the HTTP request should continue, this status code is used to reflect the current status of the request. Unless it’s something like an interruption point, where each operation stops, it becomes clear how the HTTP status code is changing.


HTTP status code summary:

Here is a summary of the main role of each HTTP state, about the detailed HTTP state interested in understanding the friends, you can click here: HTTP status code, here is baidu Encyclopedia of HTTP status code detailed analysis, is the most complete I see.

Beginning 1 :(accepted, need to continue processing.)

This type of status code indicates that the request has been accepted and needs to continue processing. This type of response is a temporary response, containing only the status line and some optional response header information, and ending with an empty line. Since no 1XX status code is defined in the HTTP/1.0 protocol, the server forbids sending 1XX responses to such clients except under certain test conditions.

100 (the client continues to send the request, which is a temporary response) : This temporary response is used to inform the client that some of its requests have been received by the server and have not yet been rejected. The client should continue to send the rest of the request, or ignore the response if the request is completed. The server must send a final response to the client after the request completes.

**101 The server switches protocols based on client requests. ** Can only switch to a more advanced protocol, for example, to the new version of HTTP.

** status code extended by WebDAV (RFC 2518) to indicate that processing will continue.

2 Indicates that the request has been successfully received, understood, and accepted by the server.

200 (Success) The server has successfully processed the request. Typically, this means that the server has provided the requested web page.

201 (Created) The request succeeded and the server created 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 information returned may come from another source.

**204 (no content) ** The server successfully processed the request but did not return anything.

205 (Reset Content) The server successfully processed the request, but did not return any content.

206 the server successfully processed some OF the GET requests.

207 (indicating that the subsequent message body will be an XML message) and may contain a separate set of response codes depending on the number of previous sub-requests.

A 3 header (the request was redirected) indicates that further action is required to complete the request. Typically, these status codes are used for redirects.

300 (Multiple options) The server can perform a variety of operations on a request. The server can select an operation based on the requester (User Agent) or provide a list of operations for the requester to select.

The page for request 301 (Permanent move) has been permanently moved to a new location. When the server returns this response (a response to a GET or HEAD request), it automatically forwards the requester to the new location.

The 302 (temporary mobile) server currently responds to requests from web pages in different locations, but requesters should continue to use the original location for future requests.

303 (View other locations) The server returns this code when the requester should use a separate GET request for a different location to retrieve the response.

**304 (unmodified) ** The requested page has not been modified since the last request. When the server returns this response, the web page content is not returned.

305 (Using a proxy) The requester can only access the requested web page using a proxy. 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 web pages in different locations, but the requester should continue to use the original location for future requests.

These status codes indicate that the request may be in error, preventing the server from processing it.

400 (Error request) Server does not understand the syntax of the request.

The 401 (unauthorized) request requires authentication. The server may return this response for a web page that requires login.

403 (Forbidden) The server rejects the request.

404 (Not found) The server could not find the requested page.

405 (method disable) Disables the method specified in the request.

406 (Not accepted) Web pages that cannot respond to a request using the requested content feature.

407 (Proxy authorization required) This status code is similar to 401 (unauthorized), but specifies that the requester should authorize the use of the proxy.

408 (Request Timeout) The server timed out while waiting for a request.

409 (Conflict) A server conflict while completing a request. The server must include information about the conflict in the response.

410 (Deleted) The server returns this response if the requested resource has been permanently deleted.

411 (Valid length required) The server will not accept requests that do not contain a valid content length header field.

412 (Conditions not met) The server does not meet one of the conditions set by the requester in the request.

413 (Request entity too large) The server cannot process the request because the request entity is too large for the server to handle.

414 (Request URI too long) The request URI (usually the url) is too long for the server to process.

415 (Unsupported media Type) The requested format is not supported by the requested page.

416 (Requested scope not required) If the page cannot provide the requested scope, the server returns this status code.

417 (Unmet expected value) The server did not meet the requirements for the “expected” request header field.

These status codes indicate that an internal error occurred while the server was trying to process the request.

These errors may be server errors rather than request errors.

500 (Server internal error) The server encountered an error and could not complete the request.

The 501 (not yet implemented) server does not have the capability to complete requests. For example, the server may return this code if it does not recognize the request method.

502 (Error Gateway) server, acting as gateway or proxy, received invalid response from upstream server.

** The server is currently unavailable (due to overloading or downtime for maintenance). Usually, this is a temporary state.

504 (Gateway Timeout) The server acted as a gateway or proxy, but did not receive the 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.

**ps: ** There are some status codes have not been written, interested in understanding, click here: HTTP Baidu Encyclopedia


Finally: code word is not easy, thank you for your support! Because I often do not understand others write to share, so personal writing is relatively small white, write bad place, welcome to give advice. Then is the hope of watching the friends point a like, can also pay attention to me. Ps: currently unemployed, coordinates Beijing, small and medium-sized company bosses to take away, QQ: 1677593011. Nuggets personal homepage, Jane book homepage link, ** CSDN blog homepage link **

References:

Common HTTP Status Code Indicates the HTTP Status Code of Baidu Encyclopedia

The above. 2017.4.27