Description of the status value of Ajax xmlHttpRequest

Source: Internet
Author: User

The status of the xmlHttpRequest object indicates the status of the current http request, which is a long integer data. Here we will introduce its meaning.

Http Request status and its meaning

1xx-Information prompt
100-the initial request has been accepted and the customer should continue to send the rest of the request. (New HTTP 1.1)
101-the server converts client-compliant requests to another protocol. (New HTTP 1.1)
2xx-success
200-OK everything is normal, and the response document to the GET and POST requests is following.
The 201-Created server has Created a document and the Location header provides its URL.
202-Accepted has Accepted the request, but the processing has not been completed.
203-the Non-Authoritative Information document has been normally returned, but some response headers may be incorrect because it uses the copy of the document and Non-Authoritative Information (New in HTTP 1.1 ).
204-No Content No new document. The browser should continue to display the original document. This status code is useful if the user regularly refreshes the page and the Servlet can determine that the user document is new enough.
205-the Reset Content does not have new Content, but the browser should Reset the Content displayed by it. Used to force the browser to clear the input content of the form (New in HTTP 1.1 ).
206-Partial Content the customer sent a GET request with a Range header, and the server completed it (HTTP 1.1 New ).
3xx-redirection
300-the documents requested by the Multiple Choices customer can be found in Multiple locations, which are listed in the returned documents. If the server needs to give priority, it should be specified in the Location response header.
301-Moved Permanently the document requested by the customer is elsewhere. The new URL is provided 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, rather than permanent. Note that the corresponding status information in HTTP1.0 is "Moved Temporatily ". When this status code appears, the browser can automatically access the new URL, so it is a very useful status code. Note that this status code can be replaced with 301 sometimes. For example, if the browser mistakenly requests http: // host /~ If the user (with a slash missing), some servers return 301, and some return 302. Strictly speaking, we can only assume that the browser will automatically redirect only when the original request is GET. See 307.
303-See Other is similar to 301/302. The difference is that if the original request is POST, the redirection target document specified by the Location header should be extracted through GET (New in HTTP 1.1 ).
304-Not Modified the client has a buffered document and issued a conditional request (generally, the If-Modified-Since header is provided to indicate that the customer only wants to update the document on a specified date ). The server tells the customer that the original buffer documentation can still be used.
305-Use the Proxy client request document should be extracted by the Proxy server specified in the Location header (New in HTTP 1.1 ).
307-Temporary Redirect and 302 (Found) are the same. Many browsers mistakenly respond to the 302 response for redirection. Even if the original request is POST, it can only be redirected when the POST request actually responds to 303. For this reason, HTTP 1.1 adds 307 to clear the region code in several states: When a 303 response occurs, the browser can follow the redirected GET and POST requests; if a 307 response occurs, the browser can only follow the redirection to get requests. (New HTTP 1.1)
4xx-client Error
400-Bad Request syntax error.
401-Unauthorized access is denied. The customer tries to access the password-protected page without authorization. The response contains a WWW-Authenticate header. the browser displays the username/password dialog box accordingly, and then sends a request again after entering the appropriate Authorization header.
404-Not Found cannot find the resource at the specified position. This is also a common response.
405-Method Not Allowed request methods (GET, POST, HEAD, DELETE, PUT, TRACE, etc.) are Not applicable to specified resources, HTTP predicates used to access this page are not allowed (methods are not allowed) (new in HTTP 1.1)
406-Not Acceptable the specified resource has been found, but its MIME type is incompatible with the one specified by the customer in the Accpet header, the client browser does not accept the MIME type of the requested page (New in HTTP 1.1 ).
407-Proxy Authentication Required requires Proxy Authentication, similar to 401, indicating that the customer must first be authorized by the Proxy server. (New HTTP 1.1)
408-Request Timeout the client has not sent any Request within the waiting time permitted by the server. The customer can repeat the same request later. (New HTTP 1.1)
409-Conflict is generally related to PUT requests. The request cannot be successful because the request conflicts with the current status of the resource. (New HTTP 1.1)
410-the document requested by Gone is no longer available, and the server does not know which address to redirect. It differs from 404 in that if 407 is returned, the document permanently leaves the specified position, and 404 indicates that the document is unavailable for unknown reasons. (New HTTP 1.1)
The 411-Length Required server cannot process the request unless the customer sends a Content-Length header. (New HTTP 1.1)
412-Precondition some of the prerequisites specified in the Failed Request Header fail (New in HTTP 1.1 ).
413-the size of the Request Entity Too Large target document exceeds the size that the server is willing to process. If the server thinks it can process the request later, it should provide a Retry-After header (New in HTTP 1.1 ).
414-Request URI Too Long URI is Too Long (HTTP 1.1 is new ).
415-unsupported media type.
416-Requested Range Not Satisfiable the server cannot meet the Range header specified by the customer in the request. (New HTTP 1.1)
417-execution failed.
423-locking error.
5xx-Server Error
500-the Internal Server Error Server encounters unexpected circumstances and cannot complete the customer's request.
501-Not Implemented server does Not support the functions required to implement the request. The header value specifies the unimplemented configuration.
502-when the Bad Gateway server acts as a Gateway or proxy, in order to complete the request to access the next server, the server returns an invalid response. In other words, the Web server receives an invalid response when it is used as a gateway or proxy server.
503-Service Unavailable Service is Unavailable, and the server fails to respond due to maintenance or heavy load. For example, Servlet may return 503 when the database connection pool is full. When the server returns 503, A Retry-After header can be provided. This error code is dedicated to IIS 6.0.
504-Gateway Timeout Gateway times out and is used by the server acting as a proxy or Gateway, indicating that the remote server cannot receive a response in a timely manner. (New in HTTP 1.1 ).
505-the HTTP Version Not Supported server does Not support the HTTP Version specified in the request. (New in HTTP 1.1 ).

Related Article

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.