HTTP Server Status Code definition (status code definitions)

Source: Internet
Author: User

1.1 Message1xx(Informational 1xx)
This type of statusCodeUsed to indicate a temporary response. Temporary response by status line (Status-line) And optional titles. The title is terminated by a blank line.HTTP/1.0Does not define any1xxStatus Code, so they are notHTTP/1.0Valid response to the request. In fact, they are mainly used for lab purposes, which is beyond the scope of this document.
1.2Successful2XX(Successful 2XX)
Indicates that the client request is successfully received, understood, and accepted.
200 OK
The request is successful. The response information depends on the method used by the request, as follows:
GetThe resource to be requested has been placed in the response entity.
HeadThere is no entity, and only the title information is included in the response.
Post Entity (describe or include operation results ).
201 created
After the request is completed, the new resource is created. The Uri It can be obtained in the response entity. The original server should create the resource before sending the status code. If this operation cannot be completed immediately, the server must give a prompt in the response body when the resource is available. Otherwise, the server should respond.202 (Acceptable ).
The method defined in this article only has Post You can create resources.
202 accepted
The request is accepted, but the processing has not been completed. The request may not be completed and may be interrupted at any time. In this case, there is no way to resend the status code in an asynchronous operation.
202 There is no obligation to respond. The purpose is to allow the server to respond to requests from other processes (such as running once a day, based on the batch processing process ).
The entities returned in some responses include the status indication of the current request, the status monitor pointer, or the user's evaluation information on whether the request can be implemented.
204 NO content
The server has implemented the request, but no new information is returned. If the customer is a user agent, do not update the document view for this. This response is mainly used to activate the document view without affecting the user proxy. Script Statement input and other operations. This response may also contain new meta information in the form of entity titles, which can be used by the documents in the active view of the current user agent.
1.3 Redirection (Redirection 3xx)
This type of Status Code indicates that the user agent needs to perform further operations to complete the request. These operations are only performed when the request isGet Or Head Can be implemented by the user agent instead of interacting with the user. The user agent never requests 5 More than one redirection operation may result in an infinite loop.
300 multiple choices
This status code is not HTTP/1.0 Application Program Directly, just 3xx Default description of Type response. Multiple available requested resources exist.
Unless it is Head Request. Otherwise, the response entity must include the character list and location information of these resources. The user or user agent determines which one is the most suitable.
If the server has a preferred choice, it should URL Information is stored in the location domain ( Location field ), The user agent will automatically redirect based on the value of this field.
301 moved permanently
All requested resources are allocated with a permanent URL In this way, you can useURL To access this resource. The client with the link editing function will automatically update the request based on the new link returned by the server as much as possible. Uri . New URL It must be specified by the location field in the response. Unless it is Head Request. Otherwise, the entity body ( Entity-body ) Must include URL A brief description of the hyperlink.
If you use Post Method to send the request and receive 301 Response status code. In this case, unless confirmed by the user, the user agent does not need to redirect the request automatically, because this will change the environment in which the request has been sent.
Note: When receiving 301 Status Code and automatic redirection Post When a request is sent, some existing user proxies mistakenly change it Get Request.
302 moved temporarily
The requested resource is in a different URL . Because redirection is sometimes changed, the client should continue to use the requestUri . New URL It must be specified by the location field in the response. Unless it is Head Request. Otherwise, the entity body ( Entity-body ) Must include URL A brief description of the hyperlink.
If you use Post Method to send the request and receive 302 Response status code. In this case, unless confirmed by the user, the user agent does not need to redirect the request automatically, because this will change the environment in which the request has been sent.
Note: When receiving 302 Status Code and automatic redirection Post When a request is sent, some existing user proxies mistakenly change it Get Request.
304 not modified
If the client successfully executes the condition Get Request, and the corresponding file from If-modified-since The domain has not been updated since the specified date. The server should respond to this status code instead of sending the entity to the client. The Response Header domain should only contain some relevant information, such as the cache manager and the latest update of the object ( Entity's last-modified . Examples of related subject domains include date, server, and expiration time. Every time 304 When the Domain value given in the response changes, the cache should update the cached entity.
1.4 Client error (Client Error)4xx
4xx The status code of the class indicates that an error occurs on the client. If the client receives 4xx The request has not been completed yet. It should immediately terminate sending data to the server. Besides response Head In addition to requests, the server must include an explanation of the error status in the response entity, whether the error is temporary or permanent. These Status Codes apply to any request method.
Note: If the client is sending data TCP The implementation should be careful to ensure that the client receives the response packet before closing the input connection. If the client still sends data to the server after it is disabled, the server will send a reset packet to the client to clear the input buffer that has not been processed by the client to terminate HTTP Read and interpret applications.
400 Illegal Request (Bad request)
If the request syntax is incorrect, the server cannot understand it. The client should not repeatedly send the request to the server before making changes to the request.
401 Unauthorized (Unauthorized)
User authorization is required for the request. In response WWW-Authenticate Title domain ( 10.16 Section) users should be prompted to request resources in an authorized manner. The client should use the appropriate authorization title domain ( 10.2 To repeat the request. If the request includes the authorization trust information 401 Indicates that the authorization is denied. If the user agent returns the same response after multiple attempts 401 Status code. You should check the response entity because the entity contains dynamic information. HTTP Access authorization will be performed in 11 .
403 Disable (Forbidden)
The server understands the request, but rejects the request. Authorization does not help. The client should stop sending this request repeatedly. If not Head If the server is willing to publish the reason why the request is not implemented, the server will write the reason for rejection in the response entity. This status code is generally used when the server does not want to disclose the details of the request being rejected or no other response is available.
404 Not found (Not found)
Server not found and request Uri Resources. 404 The status code does not indicate whether the status is temporary or permanent. If the server does not want to provide this information to the client, it also responds 403 (Forbidden) status code.
1.5 Server Error (Server Error)5xx
Response code '5' The status code at the beginning indicates that the server finds an error and cannot continue to execute the request. If the client receives 5xx Status Code, the request has not been completed, it should immediately stop sending data to the server. Besides response Head In addition to requests, the server should include an explanation of the error in its response entity and specify that the request is temporary and permanent.
This type of response code does not have a title field and can be applied to any request method.
500 Internal Server Error (Internal Server Error)
The server failed to respond to the request due to an unexpected situation.
501 Not implemented (Not Implemented)
The server cannot provide support for the functions required in the request. If the server cannot identify the request method, it will respond to this status code, which means it cannot respond to any resource requested by the request.
502 Illegal Gateway (Bad Gateway)
The server acts as a gateway or proxy from the upstream ( Upstream The server receives an invalid response.
503 Service unavailable (Service unavailable)
The server cannot process the request currently. This is generally caused by temporary server overload or maintenance. This status code implies that the situation is temporary and requires some delay.
Note:503 The status code does not imply that the server must return this status code when it is overloaded. Some servers may want to use simple processing during overload, that is, disconnect the connection.

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.