|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.core.client.JavaScriptObject
com.google.gwt.xhr.client.XMLHttpRequest
public class XMLHttpRequest
The native XMLHttpRequest object. Most applications should use the higher-
level RequestBuilder class unless they need specific functionality
provided by the XMLHttpRequest object.
http://www.w3.org/TR/XMLHttpRequest/| Field Summary | |
|---|---|
static int |
DONE
The DONE state is the state of the object when either the data transfer has been completed or something went wrong during the transfer (infinite redirects for instance). |
static int |
HEADERS_RECEIVED
The HEADERS_RECEIVED state is the state of the object when all response headers have been received. |
static int |
LOADING
The LOADING state is the state of the object when the response entity body is being received. |
static int |
OPENED
The OPENED state is the state of the object when the open() method has been successfully invoked. |
static int |
UNSENT
When constructed, the XMLHttpRequest object must be in the UNSENT state. |
| Method Summary | |
|---|---|
void |
abort()
Aborts the current request. |
void |
clearOnReadyStateChange()
Clears the ReadyStateChangeHandler. |
static XMLHttpRequest |
create()
Creates an XMLHttpRequest object. |
java.lang.String |
getAllResponseHeaders()
Gets all the HTTP response headers, as a single string. |
int |
getReadyState()
Get's the current ready-state. |
java.lang.String |
getResponseHeader(java.lang.String header)
Gets an HTTP response header. |
java.lang.String |
getResponseText()
Gets the response text. |
int |
getStatus()
Gets the status code. |
java.lang.String |
getStatusText()
Gets the status text. |
void |
open(java.lang.String httpMethod,
java.lang.String url)
Opens an asynchronous connection. |
void |
open(java.lang.String httpMethod,
java.lang.String url,
java.lang.String user)
Opens an asynchronous connection. |
void |
open(java.lang.String httpMethod,
java.lang.String url,
java.lang.String user,
java.lang.String password)
Opens an asynchronous connection. |
void |
send()
Initiates a request with no request data. |
void |
send(java.lang.String requestData)
Initiates a request with data. |
void |
setOnReadyStateChange(ReadyStateChangeHandler handler)
Sets the ReadyStateChangeHandler to be notified when the object's
ready-state changes. |
void |
setRequestHeader(java.lang.String header,
java.lang.String value)
Sets a request header. |
| Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
|---|
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int UNSENT
public static final int OPENED
public static final int HEADERS_RECEIVED
public static final int LOADING
public static final int DONE
| Method Detail |
|---|
public static XMLHttpRequest create()
public final void abort()
http://www.w3.org/TR/XMLHttpRequest/#abortpublic final void clearOnReadyStateChange()
ReadyStateChangeHandler.
clearOnReadyStateChange(),
http://www.w3.org/TR/XMLHttpRequest/#onreadystatechangepublic final java.lang.String getAllResponseHeaders()
http://www.w3.org/TR/XMLHttpRequest/#getallresponseheaderspublic final int getReadyState()
http://www.w3.org/TR/XMLHttpRequest/#readystatepublic final java.lang.String getResponseHeader(java.lang.String header)
header - the response header to be retrieved
http://www.w3.org/TR/XMLHttpRequest/#getresponseheaderpublic final java.lang.String getResponseText()
http://www.w3.org/TR/XMLHttpRequest/#responsetextpublic final int getStatus()
http://www.w3.org/TR/XMLHttpRequest/#statuspublic final java.lang.String getStatusText()
http://www.w3.org/TR/XMLHttpRequest/#statustext
public final void open(java.lang.String httpMethod,
java.lang.String url)
httpMethod - the HTTP method to useurl - the URL to be openedhttp://www.w3.org/TR/XMLHttpRequest/#open
public final void open(java.lang.String httpMethod,
java.lang.String url,
java.lang.String user)
httpMethod - the HTTP method to useurl - the URL to be openeduser - user to use in the URLhttp://www.w3.org/TR/XMLHttpRequest/#open
public final void open(java.lang.String httpMethod,
java.lang.String url,
java.lang.String user,
java.lang.String password)
httpMethod - the HTTP method to useurl - the URL to be openeduser - user to use in the URLpassword - password to use in the URLhttp://www.w3.org/TR/XMLHttpRequest/#openpublic final void send()
send(String) with null as an argument, because the
no-argument send() method is unavailable on Firefox.
public final void send(java.lang.String requestData)
requestData - the data to be sent with the requesthttp://www.w3.org/TR/XMLHttpRequest/#sendpublic final void setOnReadyStateChange(ReadyStateChangeHandler handler)
ReadyStateChangeHandler to be notified when the object's
ready-state changes.
Note: Applications must call clearOnReadyStateChange()
when they no longer need this object, to ensure that it is cleaned up
properly. Failure to do so will result in memory leaks on some browsers.
handler - the handler to be called when the ready state changesclearOnReadyStateChange(),
http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange
public final void setRequestHeader(java.lang.String header,
java.lang.String value)
header - the header to be setvalue - the header's valuehttp://www.w3.org/TR/XMLHttpRequest/#setrequestheader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||