|
||||||||||
| 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.activex.javascript.msxml.MSXMLScriptable
com.gargoylesoftware.htmlunit.activex.javascript.msxml.XMLHTTPRequest
public class XMLHTTPRequest
A JavaScript object for MSXML's (ActiveX) XMLHTTPRequest.
Provides client-side protocol support for communication with HTTP servers.
| 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 an 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 values of all the HTTP headers. |
Object |
getOnreadystatechange()
Returns the event handler to be called when the readyState property changes. |
int |
getReadyState()
Returns the state of the request. |
String |
getResponseHeader(String header)
Retrieves the value of an HTTP header from the response body. |
String |
getResponseText()
Returns the response entity body as a string. |
Object |
getResponseXML()
Returns the parsed response entity body. |
int |
getStatus()
Returns the HTTP status code returned by a request. |
String |
getStatusText()
Returns the HTTP response line status. |
void |
jsConstructor()
JavaScript constructor. |
void |
open(String method,
Object url,
boolean async,
Object user,
Object password)
Initializes the request and specifies the method, URL, and authentication information for the request. |
void |
put(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start,
Object value)
|
void |
send(Object body)
Sends an HTTP request to the server and receives a response. |
void |
setOnreadystatechange(net.sourceforge.htmlunit.corejs.javascript.Function stateChangeHandler)
Sets the event handler to be called when the readyState property changes. |
void |
setRequestHeader(String name,
String value)
Sets the specified header to the specified value. The open method must be called before this method, or an error will occur. |
| Methods inherited from class com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLScriptable |
|---|
getClassName, getEnvironment, getPrototype, makeScriptableFor, setEnvironment, setParentScope |
| Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
|---|
clone, defineFunctionProperties, defineProperty, equivalentValues, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, setCaseSensitive, setDomNode, setDomNode, setHtmlElement |
| 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()
| Method Detail |
|---|
public void jsConstructor()
public Object getOnreadystatechange()
readyState property changes.
public void setOnreadystatechange(net.sourceforge.htmlunit.corejs.javascript.Function stateChangeHandler)
readyState property changes.
stateChangeHandler - the event handler to be called when the readyState property changespublic int getReadyState()
public String getResponseText()
public Object getResponseXML()
public int getStatus()
public String getStatusText()
public void abort()
public String getAllResponseHeaders()
public String getResponseHeader(String header)
header - the case-insensitive header name
public void open(String method,
Object url,
boolean async,
Object user,
Object password)
method - the HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND;
for XMLHTTP, this parameter is not case-sensitive; the verbs TRACE and TRACK are not allowed.url - the requested URL; this can be either an absolute URL or a relative URLasync - indicator of whether the call is asynchronous; the default is true (the call returns
immediately); if set to true, attach an onreadystatechange property callback so
that you can tell when the send call has completeduser - the name of the user for authenticationpassword - the password for authenticationpublic void send(Object body)
body - the body of the message being sent with the request.
public void setRequestHeader(String name,
String value)
open method must be called before this method, or an error will occur.
name - the header name to setvalue - the value of the header
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 | |||||||||