HTTP Status Code Understanding

Source: Internet
Author: User
Tags rfc

HHTP Status Code
::::

1xx:Message this type of status code, on behalf of the request has been accepted, need to continue processing. 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

Continue: The client will also continue to send the request to the server, this is just a temporary request response, indicating that this part of the server is properly received, how your request is completed, ignoring the response, the server must send a final response to the client after the request response has ended.
101 Switching protocols: The server has understood the client's request and will notify the client through the upgrade message header to use a different protocol to complete the request. After the last empty line of the response is sent, the server switches to those protocols defined in the upgrade message header
102 Processing: Status code extended by WebDAV, representing processing will be continued execution

2xx:Success of this type of status code, on behalf of the request has been successfully received by the server, understand, and accept
OK: Successful access, the request is handled by the server properly.
201 Created: The request has been implemented, and a new resource has been established according to the request, and its URI has been returned with the location header information. If the required resources cannot be established in time, the ' 202 Accepted ' should be returned.
202 Accepted: Indicates that the server accepts the request, but it is not necessarily executed, this status code is suitable for asynchronous operations, and a response that returns a 202 status code can also allow the server to accept requests from other processes (for example, a batch-based operation that executes only once a day). Instead of having the client remain connected to the server until the batch operation is complete. Responses that accept requests for processing and return a 202 status code should include in the returned entity some information indicating the processing of the current state, as well as pointers to processing status monitors or state predictions so that the user can estimate whether the operation has completed
203 non-authoritative Information: The server has successfully processed the request, but the returned entity header meta-information is not a valid set on the original server, but a copy from a local or a third party. The current information may be a subset or a superset of the original version. For example, metadata that contains resources may cause the original server to know the superset of meta information. It is not necessary to use this status code, and it is appropriate only if the response does not use this status code to return a number of OK
204 No content: The server successfully processed the request, but did not need to return any entity content, and wanted to return the updated meta information. The response may return new or updated meta information in the form of an entity header. If these headers are present, the requested variable should be echoed, since the 204 response is forbidden to contain any message body, so it always ends with the first empty line after the message header
205 Reset Content: The server successfully processed the request and did not return anything. However, unlike the 204 response, a response that returns this status code requires the requestor to reset the document view. The response is primarily used to accept user input and immediately resets the form so that the user can easily start another input, which, like the 204 response, is also blocked from containing any message body and ends with the first empty line after the message header.3xx:Redirecting 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 this response, and the user's browser can automatically submit the required subsequent requests without user intervention if and only if the method used by the subsequent request is GET or HEAD.
301 Moved Permanently: The requested resource has been permanently moved to a new location, and any future references to this resource should use one of several URIs returned by this response. If possible, clients that have link editing capabilities should automatically modify the requested address to the address returned from the server.   Unless otherwise specified, the response is cacheable. The new permanent URI should be returned in the location domain of the response.   Unless this is a HEAD request, the response entity should contain a hyperlink to the new URI and a short description.   If this is not a GET or HEAD request, the browser disables automatic redirection unless the user confirms it, because the requested condition may vary. Note: For some browsers that use the http/1.0 protocol, when they send a POST request that gets a 301 response, the next redirect request becomes a Get method.
302 Move temporarily: The requested resource is now temporarily responding to requests from different URIs. Because such redirects are temporary, the client should continue to send subsequent requests to the original address.   This response is cacheable only if specified in Cache-control or expires. The new temporary URI should be returned in the location domain of the response.   Unless this is a HEAD request, the response entity should contain a hyperlink to the new URI and a short description.   If this is not a GET or HEAD request, then the browser disables automatic redirection unless the user confirms it, because the requested condition may vary. Note: Although the RFC 1945 and RFC 2068 specifications do not allow the client to change the method of the request during redirection, many existing browsers treat the 302 response as a 303 response, and use GET to access the URI specified in the location, ignoring the method originally requested. Status Codes 303 and 307 are added to clarify how the server expects the client to react.
303 See other: The response to the current request can be found on another URI, and the client should access that resource in a GET way. This method exists primarily to allow the output of the POST request that is activated by the script to redirect to a new resource. This new URI is not an alternative reference to the original resource. Meanwhile, a 303 response is forbidden to be cached. Of course, a second request (redirect) may be cached4xx:A status code such as a request error indicates that the client may appear to have an error that interferes with the processing of the server. Unless the response is a HEAD request, the server should return an entity that interprets the current error condition, and whether this is a temporary or permanent condition. These status codes apply to any request method. The browser should display to the user any entity content contained in such an error response. If the client is transmitting data when an error occurs, the server implementation using TCP should carefully ensure that the client has received a packet containing the error message before shutting down the connection between the client and the server. If the client continues to send data to the server after receiving the error message, the server's TCP stack sends a reset packet to the client to clear all unrecognized input buffers for that client, lest the data be read by the application on the server and interfere with the latter
The bad request:1, the semantic error, the current request failed, the requested resources are not found on the server. No information can tell the user whether the situation is temporary or permanent. If the server knows the situation, it should use the 410 status code to tell the old resources because of some internal configuration mechanism problems, has been permanently unavailable, and there is no jump to the address. 404 This status code is widely used when the server does not want to reveal exactly why the request was rejected or if no other appropriate response is available. The most likely cause of this error is that the server side does not have this page
The request could not be understood by the server. Unless modified, the client should not submit the request repeatedly.
2, the request parameter is wrong.
401 Unauthorized: The current request requires user authentication. The response must contain a Www-authenticate information header for the requested resource to ask for user information. The client can repeatedly submit a request that contains the appropriate Authorization header information. If the current request already contains the Authorization certificate, the 401 response indicates that the certificate has been rejected by the server authentication. If the 401 response contains the same authentication query as the previous response, and the browser has tried at least one validation, the browser should show the user the entity information contained in the response, because the entity information may contain related diagnostic information
403 Forbidden: The server has understood the request, but refuses to execute it. Unlike the 401 response, authentication does not provide any help, and the request should not be repeated. If this is not a HEAD request, and the server wants to be able to explain why the request cannot be executed, then the reason for the rejection should be described within the entity. Of course the server can also return a 404 response if it does not want the client to get any information
404 Not Found: The request failed and the requested resource was not found on the server. No information can tell the user whether the situation is temporary or permanent. If the server knows the situation, it should use the 410 status code to tell the old resources because of some internal configuration mechanism problems, has been permanently unavailable, and there is no jump to the address. 404 This status code is widely used when the server does not want to reveal exactly why the request was rejected or if no other appropriate response is available. The most likely cause of this error is that the server side does not have this page
405 Method Not allowed: Request methods specified in the request line cannot be used to request the appropriate resource. The response must return an allow header to indicate a list of request methods that the current resource can accept
413 Request Rntity Too Large: The server refuses to process the current request because the size of the entity data submitted by the request exceeds the scope that the server is willing or able to handle. In this case, the server can close the connection to prevent the client from continuing to send this request. If this condition is temporary, the server should return a retry-after response header to tell the client how much time it can retry
414 Request-uri Too Long: The requested URI length exceeds the length that the server can interpret, so the server refuses to service the request. This is rare, and the usual situations include:
A form submission that should use the Post method becomes a Get method that causes the query string to be too long.
REDIRECT uri "Black Hole", for example, each redirect takes the old Uri as part of the new URI, resulting in a long URI after several redirects.
The client is trying to exploit a security vulnerability in some servers to attack the server. This type of server uses a fixed-length buffer to read or manipulate the requested URI, and when the GET parameter exceeds a certain value, a buffer overflow may result, resulting in arbitrary code being executed [1]. A server that does not have such a vulnerability should return a 414 status code.5xx: Server error This type of status code indicates that the server has an error or an abnormal state in the process of processing the request, and it is possible that the server is aware that the processing of the request cannot be completed with the current hardware and software resources. Unless this is a head request, the server should contain an explanatory information entity that interprets the current error state and whether the condition is temporary or permanent. The browser should show the user any entities that are contained in the current response
Internal Server Error: The server encountered an unexpected condition that prevented it from completing the processing of the request. In general, this problem occurs when the source code on the server side is wrong.

:::

HTTP Status Code Understanding

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.