java.lang.Object | ||
↳ | com.google.gwt.core.client.JavaScriptObject | |
↳ | com.google.gwt.xhr.client.XMLHttpRequest |
The native XMLHttpRequest object. Most applications should use the higher-
level RequestBuilder
class unless they
need specific functionality provided by the XMLHttpRequest object.
See http://www.w3.org/TR/XMLHttpRequest//
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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). | |||||||||
int | HEADERS_RECEIVED | The HEADERS_RECEIVED state is the state of the object when all response headers have been received. | |||||||||
int | LOADING | The LOADING state is the state of the object when the response entity body is being received. | |||||||||
int | OPENED | The OPENED state is the state of the object when the open() method has been successfully invoked. | |||||||||
int | UNSENT | When constructed, the XMLHttpRequest object must be in the UNSENT state. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Aborts the current request.
| |||||||||||
Clears the
ReadyStateChangeHandler . | |||||||||||
Creates an XMLHttpRequest object.
| |||||||||||
Gets all the HTTP response headers, as a single string.
| |||||||||||
Get's the current ready-state.
| |||||||||||
Gets an HTTP response header.
| |||||||||||
Gets the response text.
| |||||||||||
Gets the status code.
| |||||||||||
Gets the status text.
| |||||||||||
Opens an asynchronous connection.
| |||||||||||
Opens an asynchronous connection.
| |||||||||||
Opens an asynchronous connection.
| |||||||||||
Initiates a request with no request data.
| |||||||||||
Initiates a request with data.
| |||||||||||
Sets the
ReadyStateChangeHandler to be notified when the object's
ready-state changes. | |||||||||||
Sets a request header.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.core.client.JavaScriptObject
| |||||||||||
From class
java.lang.Object
|
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).
The HEADERS_RECEIVED state is the state of the object when all response headers have been received.
The LOADING state is the state of the object when the response entity body is being received.
The OPENED state is the state of the object when the open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using send().
When constructed, the XMLHttpRequest object must be in the UNSENT state.
Aborts the current request.
Gets all the HTTP response headers, as a single string.
See http://www.w3.org/TR/XMLHttpRequest/#getallresponseheaders.
Get's the current ready-state.
Gets an HTTP response header.
header | the response header to be retrieved |
---|
Gets the status code.
Opens an asynchronous connection.
httpMethod | the HTTP method to use |
---|---|
url | the URL to be opened |
user | user to use in the URL |
password | password to use in the URL |
Opens an asynchronous connection.
httpMethod | the HTTP method to use |
---|---|
url | the URL to be opened |
user | user to use in the URL |
Opens an asynchronous connection.
httpMethod | the HTTP method to use |
---|---|
url | the URL to be opened |
Initiates a request with no request data. This simply calls
send(String)
with null
as an argument, because the
no-argument send()
method is unavailable on Firefox.
Initiates a request with data. If there is no data, specify null.
requestData | the data to be sent with the request |
---|
Sets the ReadyStateChangeHandler
to be notified when the object's
ready-state changes.
See http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange.
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 changes |
---|
Sets a request header.
header | the header to be set |
---|---|
value | the header's value |