The meaning of the value of the status of XMLHttpRequest

Source: Internet
Author: User

Turn from: http://www.cnblogs.com/zhubaoxu/archive/2008/03/17/1109315.html

Although often write Ajax aspects of things, but rarely to specifically understand the XMLHttpRequest status of the meaning of each value, but in the use of Google, the following will be others have summarized the reprint, learning to learn.

The status of the XMLHttpRequest object represents the state of the current HTTP request, is a long integer data, and now describes what it means.

HTTP request status and its meaning table1xx-Information Tips100-The initial request has been accepted and the customer should continue to send the remainder of the request. (HTTP 1.1 New) 101-The server converts requests to a different protocol to comply with the customer's request. (HTTP 1.1 new)2xx-Success200-ok everything is fine, the answer document for Get and post requests follows. The 201-created server has created the document, and the location header gives its URL. 202-accepted has accepted the request, but processing has not yet completed. The 203-non-authoritative information document has returned normally, but some answer headers may be incorrect because a copy of the document is being used, not authoritative information (HTTP 1.1 new). 204-no Content does not have a new document, the browser should continue to display the original document. This status code is useful if the user periodically refreshes the page and the servlet can determine that the user's document is new enough. 205-reset content has no new contents, but the browser should reset what it displays. Used to force the browser to clear form input (HTTP 1.1 new). 206-partial Content customer sent a GET request with a range header, and the server completed it (HTTP 1.1 new).3xx- redirect300-multiple choices Client-requested documents can be found in multiple locations, which are already listed in the returned document. If the server wants to make a preference, it should be indicated in the location answer header. 301-moved permanently client-requested documents elsewhere, the new URL is given in the location header, and the browser should automatically access the new URL. 302-found is similar to 301, but the new URL should be treated as a temporary alternative, not permanent. Note that the corresponding state information in the HTTP1.0 is "moved temporatily". When this status code appears, the browser can automatically access the new URL, so it is a useful status code. Note that this status code can sometimes be replaced with 301. For example, if the browser incorrectly requests Http://host/~user (a trailing slash is missing), some servers return 301, and some return 302. Strictly speaking, we can only assume that the browser will automatically redirect only if the original request is get. Please see 307. 303-see is similar to 301/302, except that if the original request was a post,location header specified redirect target document should be extracted via get (HTTP 1.1 new). 304-not Modified The client has a buffered document and makes a conditional request (typically providing a if-modified-since header that indicates that the customer wants to update only a document that is newer than the specified date). The server tells the customer that the previously buffered document can continue to be used. 305-use Proxy Client-requested documents should be extracted via the proxy server indicated by the location header (HTTP 1.1 new). 307-temporary Redirect and 302 (Found) are the same. Many browsers incorrectly respond to 302 responses for redirection, even if the original request is post, even if it is actually only redirected when the POST request is answered at 303. For this reason, HTTP 1.1 has been added 307 to further clear the locale code: when a 303 reply occurs, the browser can follow the redirected get and post requests, and if 307 answers, the browser can only follow the redirection of the got request. (HTTP 1.1 new)4xx-Client Error A syntax error occurred in the 400-bad request. 401-unauthorized access was denied and the customer attempted to access a password-protected page without authorization. A www-authenticate header is included in the answer, the browser displays the user name/password dialog Accordingly, and then makes the request again after filling in the appropriate authorization header. 404-not Found cannot find a resource at the specified location. This is also a common answer. The 405-method not allowed request method (GET, POST, head, DELETE, put, Trace, and so on) does not apply to the specified resource, and HTTP predicates used to access this page are not allowed (methods are not allowed) (HTTP 1.1 new) 406-not Acceptable the specified resource has been found, but its MIME type is incompatible with the client specified in the Accpet header, and the client browser does not accept the MIME type of the requested page (HTTP 1.1 new). 407-proxy authentication Required requires proxy authentication, similar to 401, which means that the customer must first be authorized by the proxy server. (HTTP 1.1 new) 408-request Timeout the customer has not made any requests for the duration of the server license. Customers can repeat the same request at a later time. (HTTP 1.1 new) 409-conflict are usually associated with put requests. The request cannot succeed because the request and the current state of the resource are conflicting. (HTTP 1.1 new) 410-gone The requested document is no longer available and the server does not know which address should be redirected to. It differs from 404 in that the return of 407 indicates that the document left the specified location permanently, while 404 indicates that the document is not available because of an unknown reason. (HTTP 1.1 new) 411-length Required server cannot process requests unless the client sends a content-length header. (HTTP 1.1 new) 412-precondition Some prerequisites specified in the Failed request header failed (HTTP 1.1 new). 413–request Entity Too Large the size of the target document exceeds the size that the server is currently willing to handle. If the server considers itself able to process the request later, it should provide a Retry-after header (HTTP 1.1 new). 414-request URI Too Long URI (HTTP 1.1 new). 415– Media types that are not supported. The 416–requested range not satisfiable server does not meet the range header specified by the customer in the request. (HTTP 1.1 New) 417– execution failed. 423– the locked error.5xx-Server errorThe 500-internal server Error servers encountered unexpected conditions and could not complete the customer's request. The 501-not implemented server does not support the functionality required to implement the request, and the header value specifies the not implemented configuration. The 502-bad gateway server, as a gateway or proxy, accesses the next server in order to complete the request, but the server returns an illegal reply. It is also said that the Web server received an invalid response when it was used as a gateway or proxy server. The 503-service unavailable service is unavailable and the server fails to respond due to maintenance or overload. For example, a servlet might return 503 if the database connection pool is full. The server can provide a retry-after header when it returns 503. This error code is private to IIS 6.0. 504-gateway Timeout Network Guan Shu is used by a server acting as a proxy or gateway, indicating that the answer cannot be received from the remote server in a timely manner. (HTTP 1.1 new). The 505-http version not supported server does not support HTTP versions as specified in the request. (HTTP 1.1 new).

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.