About HTTP and XMLHTTP Status code overview

Source: Internet
Author: User
Tags object continue header range reset string version access
Xml
   (i) HTTP 1.1 supported status codes
  
Continue Initial request has been accepted and the customer should continue to send the remainder of the request
  
The switching protocols server converts requests to a different protocol for compliance with the customer
  
All OK, the answer document for Get and post requests follows.
  
The 201 Created Server has created the document, and the location header gives its URL.
  
The accepted has accepted the request, but the processing has not yet been completed.
  
203 Non-authoritative Information The document has returned normally, but some of the answer headers may be incorrect because a copy of the document is being used
  
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 The Reset content does not have new content, but the browser should reset what it displays. Used to force the browser to clear form input
  
206 Partial Content Customer sent a GET request with a range header, and the server completed it
  
Multiple choices customer-requested documents can be found in multiple locations that are already listed in the returned document. If the server wants to make a preference, it should be indicated in the location answer header.
  
Moved permanently customer requested document elsewhere, the new URL is given in the location header, and the browser should automatically access the new URL.
  
The 302 Found is similar to 301, but the new URL should be treated as a temporary alternative, not permanent.
  
303 The other is similar to 301/302, except that if the original request was post,location the redirected target document specified by the header should be fetched through the get
  
The 304 not Modified client has buffered documents and makes a conditional request (typically providing a if-modified-since header that indicates that the customer only wants to update the document for a specified date). The server tells the customer that the previously buffered document can continue to be used.
  
305 Use proxy Client-requested documentation should be extracted via proxy server specified by location header
  
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.
  
Bad request syntax error occurred.
  
401 Unauthorized customer is trying 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.
  
403 Forbidden Resource is not available.
  
404 Not Found Cannot find a resource at the specified location
  
The 405 method does not allowed request methods (GET, POST, head, DELETE, put, Trace, and so on) do not apply to the specified resource.
  
406 not acceptable the specified resource has been found, but its MIME type is incompatible with the client specified in the Accpet header
  
The 407 proxy authentication Required is similar to 401, which means that the customer must first be authorized by the proxy server.
  
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.
  
409 Conflict are usually associated with put requests. The request cannot succeed because the request and the current state of the resource are conflicting.
  
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.
  
411 Length Required The server cannot process the request unless the customer sends a content-length header.
  
412 precondition Some prerequisites specified in the Failed request header failed
  
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
  
414 Request Uri Too long URI
  
416 requested range not satisfiable server does not meet the range header specified by the customer in the request
  
Internal Server Error Server encountered unexpected situation, unable to complete customer's request
  
The 501 not implemented server does not support the functionality required to implement the request. For example, the customer issued a put request that the server does not support
  
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 answer
  
503 Service unavailable Server failed to answer due to maintenance or overload. For example, a servlet might return 503 if the database connection pool is full. A retry-after header can be supplied when the server returns 503
  
The 504 Gateway Timeout is used by a server acting as a proxy or gateway, indicating that a response cannot be received from a remote server in a timely manner
  
505 HTTP version not supported server does not support HTTP versions as specified in the request
  
   (ii) XMLHttpRequest object method
  
Abort () Stop the current request
getAllResponseHeaders () returns the complete headers as a string
getResponseHeader ("Headerlabel") returns a single header label as a string
Open ("Method", "URL" [, asyncflag[, "UserName" [, "Password"]]) sets the target URL, methods, and other parameters for pending requests
Send (content) request
setRequestHeader ("label", "value") sets the header and sends it along with the request
  
   (iii) XMLHttpRequest object Properties
  
onReadyStateChange event triggers with state changes
ReadyState Object State (integer):
0 = not initialized
1 = in read
2 = Read
3 = in interaction
4 = Complete
ResponseText The server process returns a text version of the data
Responsexml a compatible DOM XML Document object that returns data to the server process
Status code returned by the status server, such as: 404 = "Found at end of file", 200 = "Success"
StatusText status text information returned by the server

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.