XMLHTTP Request

 

Method Description
open(method, URL)
open(method, URL, async)
open(method, URL, async, username)
open(method, URL, async, username, password)
Specifies the arguments and other optional attributes of a request. Method parameter can be one of the following, or other HTTP methods:
• DELETE
• GET
• HEAD
• POST
• PUT
Async parameter specifies whether the request is asynchronous or not. Possible values:
• true: asynchronous (continue without waiting for response)
• false: not asynchronous (wait for response)
abort() Cancels the request
getAllResponseHeaders() Returns all HTTP headers as string.
getResponseHeader(headerName) Returns the value of headerName.
send(content) Send the request with or without content.
setRequestHeader(lable,value) Add a label/value pair to the HTTP header.
   
Property Description
readyState Returns the state of the Request object with one of the following values:
• 0 = uninitialized,open() not yet called
• 1 = open,send() not yet called
• 2 = request sent,headers and status available
• 3 = reveiving or downloading responseText but holds only partial data
• 4 = finished
responseText Returns the response as a string.
Status Returns the HTTP status code: 200,301,302,404 etc.
statusText Returns the status as a string.That is,return the string equivalent of the HTTP status code.
posted @ 2013-11-22 16:33  dushuai  阅读(130)  评论(0编辑  收藏  举报