|
||||||||||
| 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.
| Field Summary | |
|---|---|
static int |
STATE_DONE
All the data has been received; the complete data is available in responseBody and responseText. |
static int |
STATE_HEADERS_RECEIVED
The send() method has been called, but the status and headers are not yet available. |
static int |
STATE_LOADING
Some data has been received. |
static int |
STATE_OPENED
The object has been created, but the send() method has not been called. |
static int |
STATE_UNSENT
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 | |
|---|---|
void |
abort()
Cancels the current HTTP request. |
Object |
get(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Gets a named property from the object. |
String |
getAllResponseHeaders()
Returns the labels and values of all the HTTP headers. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnerror()
Returns the event handler that fires on error. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnload()
Returns the event handler that fires on load. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnreadystatechange()
Returns the event handler that fires on every state change. |
int |
getReadyState()
Returns the current state of the HTTP request. |
String |
getResponseHeader(String headerName)
Retrieves the value of an HTTP header from the response body. |
String |
getResponseText()
Returns a string version of the data retrieved from the server. |
Object |
getResponseXML()
Returns a DOM-compatible document object version of the data retrieved from the server. |
int |
getStatus()
Returns the numeric status returned by the server, such as 404 for "Not Found" or 200 for "OK". |
String |
getStatusText()
Returns the string message accompanying the status code, such as "Not Found" or "OK". |
boolean |
getWithCredentials()
Returns the "withCredentials" property. |
void |
jsConstructor()
JavaScript constructor. |
void |
open(String method,
Object urlParam,
boolean async,
Object user,
Object password)
Assigns the destination URL, method and other optional attributes of a pending request. |
void |
overrideMimeType(String mimeType)
Override the mime type returned by the server (if any). |
void |
put(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start,
Object value)
|
void |
send(Object content)
Sends the specified content to the server in an HTTP request and receives the response. |
void |
setOnerror(net.sourceforge.htmlunit.corejs.javascript.Function errorHandler)
Sets the event handler that fires on error. |
void |
setOnload(net.sourceforge.htmlunit.corejs.javascript.Function loadHandler)
Sets the event handler that fires on load. |
void |
setOnreadystatechange(net.sourceforge.htmlunit.corejs.javascript.Function stateChangeHandler)
Sets the event handler that fires on every state change. |
void |
setRequestHeader(String name,
String value)
Sets the specified header to the specified value. |
void |
setWithCredentials(boolean withCredentials)
Sets the "withCredentials" property. |
| 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, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement, setParentScope |
| Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
|---|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int STATE_UNSENT
public static final int STATE_OPENED
public static final int STATE_HEADERS_RECEIVED
public static final int STATE_LOADING
public static final int STATE_DONE
| Constructor Detail |
|---|
public XMLHttpRequest()
public XMLHttpRequest(boolean caseSensitiveProperties)
caseSensitiveProperties - if properties and methods are case sensitive| Method Detail |
|---|
public void jsConstructor()
public net.sourceforge.htmlunit.corejs.javascript.Function getOnreadystatechange()
public void setOnreadystatechange(net.sourceforge.htmlunit.corejs.javascript.Function stateChangeHandler)
stateChangeHandler - the event handler that fires on every state changepublic net.sourceforge.htmlunit.corejs.javascript.Function getOnload()
public void setOnload(net.sourceforge.htmlunit.corejs.javascript.Function loadHandler)
loadHandler - the event handler that fires on loadpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnerror()
public void setOnerror(net.sourceforge.htmlunit.corejs.javascript.Function errorHandler)
errorHandler - the event handler that fires on errorpublic int getReadyState()
public String getResponseText()
public Object getResponseXML()
public int getStatus()
public String getStatusText()
public void abort()
public String getAllResponseHeaders()
public String getResponseHeader(String headerName)
headerName - the (case-insensitive) name of the header to retrieve
public void open(String method,
Object urlParam,
boolean async,
Object user,
Object 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 send(Object content)
content - the body of the message being sent with the request
public void setRequestHeader(String name,
String value)
name - the name of the header being setvalue - the value of the header being setpublic void overrideMimeType(String mimeType)
mimeType - the type used to override that returned by the server (if any)public boolean getWithCredentials()
public void setWithCredentials(boolean withCredentials)
withCredentials - the "withCredentials" property.
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.Scriptableget 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.Scriptableput in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||