|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest
public class XMLHttpRequest
A JavaScript object for a XMLHttpRequest.
Field Summary | |
---|---|
static int |
STATE_COMPLETED
All the data has been received; the complete data is available in responseBody and responseText. |
static int |
STATE_INTERACTIVE
Some data has been received. |
static int |
STATE_LOADED
The send() method has been called, but the status and headers are not yet available. |
static int |
STATE_LOADING
The object has been created, but the send() method has not been called. |
static int |
STATE_UNINITIALIZED
The object has been created, but not initialized (the open() method has not been called). |
Fields inherited from class org.mozilla.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface org.mozilla.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
XMLHttpRequest()
Creates a new instance. |
Method Summary | |
---|---|
void |
jsConstructor()
Javascript constructor. |
void |
jsxFunction_abort()
Cancels the current HTTP request. |
java.lang.String |
jsxFunction_getAllResponseHeaders()
Returns the labels and values of all the HTTP headers. |
java.lang.String |
jsxFunction_getResponseHeader(java.lang.String headerName)
Retrieves the value of an HTTP header from the response body. |
void |
jsxFunction_open(java.lang.String method,
java.lang.String url,
boolean async,
java.lang.String user,
java.lang.String password)
Assigns the destination URL, method and other optional attributes of a pending request. |
void |
jsxFunction_overrideMimeType(java.lang.String mimeType)
Override the mime type returned by the server (if any). |
void |
jsxFunction_send(java.lang.Object content)
Sends the specified content to the server in an HTTP request and receives the response. |
void |
jsxFunction_setRequestHeader(java.lang.String name,
java.lang.String value)
Sets the specified header to the specified value. |
org.mozilla.javascript.Function |
jsxGet_onreadystatechange()
Returns the event handler that fires on every state change. |
int |
jsxGet_readyState()
Returns the current state of the HTTP request. |
java.lang.String |
jsxGet_responseText()
Returns a string version of the data retrieved from the server. |
java.lang.Object |
jsxGet_responseXML()
Returns a DOM-compatible document object version of the data retrieved from the server. |
int |
jsxGet_status()
Returns the numeric status returned by the server, such as 404 for "Not Found" or 200 for "OK". |
java.lang.String |
jsxGet_statusText()
Returns the string message accompanying the status code, such as "Not Found" or "OK". |
void |
jsxSet_onreadystatechange(org.mozilla.javascript.Function stateChangeHandler)
Sets the event handler that fires on every state change. |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
get, getBooleanArg, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getHtmlElementOrDie, getHtmlElementOrNull, getIntArg, getObjectArg, getStringArg, makeScriptableFor, setDomNode, setHtmlElement |
Methods inherited from class org.mozilla.javascript.ScriptableObject |
---|
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STATE_COMPLETED
public static final int STATE_INTERACTIVE
public static final int STATE_LOADED
public static final int STATE_LOADING
public static final int STATE_UNINITIALIZED
Constructor Detail |
---|
public XMLHttpRequest()
Method Detail |
---|
public void jsConstructor()
public void jsxFunction_abort()
public java.lang.String jsxFunction_getAllResponseHeaders()
public java.lang.String jsxFunction_getResponseHeader(java.lang.String headerName)
headerName
- The (case-insensitive) name of the header to retrieve.
public void jsxFunction_open(java.lang.String method, java.lang.String url, boolean async, java.lang.String user, java.lang.String password)
method
- The method to use to send the request to the server (GET, POST, etc).url
- The url to send the request to.async
- Whether or not to send the request to the server asynchronously.user
- If authentication is needed for the specified URL, the username to use to authenticate.password
- If authentication is needed for the specified URL, the password to use to authenticate.public void jsxFunction_overrideMimeType(java.lang.String mimeType)
mimeType
- the type used to override that returned by the server (if any)public void jsxFunction_send(java.lang.Object content)
content
- The body of the message being sent with the request.public void jsxFunction_setRequestHeader(java.lang.String name, java.lang.String value)
name
- The name of the header being set.value
- The value of the header being set.public org.mozilla.javascript.Function jsxGet_onreadystatechange()
public int jsxGet_readyState()
public java.lang.String jsxGet_responseText()
public java.lang.Object jsxGet_responseXML()
public int jsxGet_status()
public java.lang.String jsxGet_statusText()
public void jsxSet_onreadystatechange(org.mozilla.javascript.Function stateChangeHandler)
stateChangeHandler
- The event handler that fires on every state change.
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |