|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest
public class XMLHttpRequest
A JavaScript object for a XMLHttpRequest.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
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 net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
XMLHttpRequest()
Creates a new instance. |
|
XMLHttpRequest(boolean caseSensitiveProperties)
Creates a new instance. |
Method Summary | |
---|---|
Object |
get(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Gets a named property from the object. |
void |
jsConstructor()
JavaScript constructor. |
void |
jsxFunction_abort()
Cancels the current HTTP request. |
String |
jsxFunction_getAllResponseHeaders()
Returns the labels and values of all the HTTP headers. |
String |
jsxFunction_getResponseHeader(String headerName)
Retrieves the value of an HTTP header from the response body. |
void |
jsxFunction_open(String method,
Object urlParam,
boolean async,
String user,
String password)
Assigns the destination URL, method and other optional attributes of a pending request. |
void |
jsxFunction_overrideMimeType(String mimeType)
Override the mime type returned by the server (if any). |
void |
jsxFunction_send(Object content)
Sends the specified content to the server in an HTTP request and receives the response. |
void |
jsxFunction_setRequestHeader(String name,
String value)
Sets the specified header to the specified value. |
net.sourceforge.htmlunit.corejs.javascript.Function |
jsxGet_onerror()
Returns the event handler that fires on error. |
net.sourceforge.htmlunit.corejs.javascript.Function |
jsxGet_onload()
Returns the event handler that fires on load. |
net.sourceforge.htmlunit.corejs.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. |
String |
jsxGet_responseText()
Returns a string version of the data retrieved from the server. |
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". |
String |
jsxGet_statusText()
Returns the string message accompanying the status code, such as "Not Found" or "OK". |
void |
jsxSet_onerror(net.sourceforge.htmlunit.corejs.javascript.Function errorHandler)
Sets the event handler that fires on error. |
void |
jsxSet_onload(net.sourceforge.htmlunit.corejs.javascript.Function loadHandler)
Sets the event handler that fires on load. |
void |
jsxSet_onreadystatechange(net.sourceforge.htmlunit.corejs.javascript.Function stateChangeHandler)
Sets the event handler that fires on every state change. |
void |
put(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start,
Object value)
|
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
clone, defineFunctionProperties, defineProperty, equivalentValues, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement |
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
public static final int STATE_UNINITIALIZED
public static final int STATE_LOADING
public static final int STATE_LOADED
public static final int STATE_INTERACTIVE
public static final int STATE_COMPLETED
Constructor Detail |
---|
public XMLHttpRequest()
public XMLHttpRequest(boolean caseSensitiveProperties)
caseSensitiveProperties
- if properties and methods are case sensitiveMethod Detail |
---|
public void jsConstructor()
public net.sourceforge.htmlunit.corejs.javascript.Function jsxGet_onreadystatechange()
public void jsxSet_onreadystatechange(net.sourceforge.htmlunit.corejs.javascript.Function stateChangeHandler)
stateChangeHandler
- the event handler that fires on every state changepublic net.sourceforge.htmlunit.corejs.javascript.Function jsxGet_onload()
public void jsxSet_onload(net.sourceforge.htmlunit.corejs.javascript.Function loadHandler)
loadHandler
- the event handler that fires on loadpublic net.sourceforge.htmlunit.corejs.javascript.Function jsxGet_onerror()
public void jsxSet_onerror(net.sourceforge.htmlunit.corejs.javascript.Function errorHandler)
errorHandler
- the event handler that fires on errorpublic int jsxGet_readyState()
public String jsxGet_responseText()
public Object jsxGet_responseXML()
public int jsxGet_status()
public String jsxGet_statusText()
public void jsxFunction_abort()
public String jsxFunction_getAllResponseHeaders()
public String jsxFunction_getResponseHeader(String headerName)
headerName
- the (case-insensitive) name of the header to retrieve
public void jsxFunction_open(String method, Object urlParam, boolean async, String user, String password)
method
- the method to use to send the request to the server (GET, POST, etc)urlParam
- the URL to send the request toasync
- Whether or not to send the request to the server asynchronouslyuser
- If authentication is needed for the specified URL, the username to use to authenticatepassword
- If authentication is needed for the specified URL, the password to use to authenticatepublic void jsxFunction_send(Object content)
content
- the body of the message being sent with the requestpublic void jsxFunction_setRequestHeader(String name, String value)
name
- the name of the header being setvalue
- the value of the header being setpublic void jsxFunction_overrideMimeType(String mimeType)
mimeType
- the type used to override that returned by the server (if any)public Object get(String name, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
SimpleScriptable.getWithPreemption(String)
.
For fallback case just implement ScriptableWithFallbackGetter
.
get
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
get
in class SimpleScriptable
public void put(String name, net.sourceforge.htmlunit.corejs.javascript.Scriptable start, Object value)
put
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
put
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |