Status code for HTTP protocol

Source: Internet
Author: User
Tags rfc

For web programmers, it is necessary to familiarize yourself with the status code of the HTTP protocol, many of which may soon be able to locate the error message based on the status code of the HTTP protocol! All HTTP status codes are sorted out today.

The HTTP status code is the 3-digit code used to represent the HTTP response status of the Web server. It is defined by the RFC 2616 specification and is extended by RFC 2518, RFC 2817, RFC 2295, RFC 2774, RFC 4918, and other specifications. The first number of all status codes represents one of the five states of the response.

http/1.1 defines the status code value and the corresponding reason phrase (reason-phrase) example.

1XX means: Message

This type of status code, on behalf of which the request has been accepted, needs to be processed. This type of response is a temporary response that contains only the status line and some optional response header information and ends with a blank line. Because no 1XX status codes are defined in the HTTP/1.0 protocol, the server prohibits sending a 1xx response to such clients unless under some experimental conditions. These status codes represent a response that is informational and identifies other actions that the customer should take.

100 (continued) The requesting person shall continue to make the request. The server returns this code to indicate that the first part of the request was received and is waiting for the remainder.

101 (switching protocol) The requestor has asked the server to switch protocols, and the server has confirmed and is ready to switch.

2XX means: Success

This type of status code 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 indicates that the server provided the requested Web page.

201 (created) The request was successful and the server created a new resource.

202 (accepted) the server has accepted the request but has not yet processed it.

203 (non-authoritative information) the server has successfully processed the request, but the information returned may be 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) The server successfully processed a partial GET request.
3XX means: redirect

This type of status code represents the need for the client to take further action to complete the request. Typically, these status codes are used for redirection, and subsequent request addresses (redirected targets) are indicated in the location domain of the response.
300 (multiple options) for requests, the server can perform a variety of operations. The server can select an action based on the requestor (user agent) or provide a list of actions for the requestor to select.

301 (permanently moved) The requested page has been permanently moved to a new location. When the server returns this response (a response to a GET or HEAD request), the requestor is automatically forwarded to the new location.

302 (Temporary move) The server is currently responding to requests from a Web page in a different location, but the requestor should continue to use the original location for future requests.

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

304 (not modified) The requested webpage 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 requestor can only use the proxy to access the requested Web page. If the server returns this response, it also indicates that the requestor should use the proxy.

307 (Temporary redirect) The server is currently responding to requests from a Web page in a different location, but the requestor should continue to use the original location for future requests.

4XX indicates: Client error

This type of status code indicates that the client may appear to have an error that prevents the server from processing.

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

401 (unauthorized) request authentication is required. The server may return this response for pages that need to log on.

403 (Forbidden) The server rejects the request.

404 (not found) The requested Web page was not found by the server.

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

406 (not accepted) cannot use the requested content attribute to respond to the requested Web page.

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

408 (Request timed out) A timeout occurred while the server was waiting for a request.

409 (conflict) The server has a conflict when it finishes the request. The server must include information about the conflict in the response.

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

411 (requires valid length) The server does not accept requests that do not contain a valid Content-Length header field.

412 (precondition not met) the server does not meet one of the prerequisites set by the requestor in the request.

413 (Request entity too Large) The server cannot process the request because the request entity is too large to exceed the processing power of the server.

414 (The requested URI is too long) The requested 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 (The request scope does not meet the requirements) if the page cannot provide the requested scope, the server returns this status code.

417 (unmet expectations) the server does not meet the requirements for the expected Request header field.
5XX indicates: Server error

This type of status code indicates that the server has an error or an abnormal state occurred during the processing of the request.

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

501 (not yet implemented) the server does not have the capability to complete the request. For example, this code may be returned when the server does not recognize the request method.

502 (Error Gateway) The server receives an invalid response from the upstream server as a gateway or proxy.

503 (Service Unavailable) the server is not currently available (due to overloading or downtime maintenance). Typically, this is only a temporary state.

504 (Gateway Timeout) The server acts as a gateway or proxy, but does not receive requests from the upstream server in a timely manner.

505 (HTTP version not supported) the HTTP protocol version used in the request is not supported by the server.

Status code for HTTP protocol

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.