Package org.loboevolution.http
Class HttpRequest
- All Implemented Interfaces:
EventTarget,ScriptableDelegate,XMLHttpRequestEventTarget
- Direct Known Subclasses:
XMLHttpRequestImpl
HttpRequest class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()abort.voidaddReadyStateChangeListener.getAllResponseHeaders.protected StringThis is the charset used to post data provided to send.intGetter for the field readyState.byte[]Getter for the field responseBytes.getResponseHeader(String headerName) getResponseHeader.getResponseText.getResponseXML.intGetter for the field status.Getter for the field statusText.voidopen.voidopen.voidopen.voidopen.voidopen.voidopen.voidopen.voidOpens the request.voidSends POST content, if any, and causes the request to proceed.Methods inherited from class org.loboevolution.html.js.xml.XMLHttpRequestEventTargetImpl
getOnabort, getOnerror, getOnload, getOnloadend, getOnloadstart, getOnprogress, getOntimeout, setOnabort, setOnerror, setOnload, setOnloadend, setOnloadstart, setOnprogress, setOntimeoutMethods inherited from class org.loboevolution.html.dom.nodeimpl.event.EventTargetImpl
addEventListener, addEventListener, dispatchEvent, dispatchEvent, getFunction, removeEventListener, removeEventListenerMethods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListener
-
Field Details
-
responseHeadersMap
-
-
Constructor Details
-
Method Details
-
abort
public void abort()abort.
-
addReadyStateChangeListener
addReadyStateChangeListener.
- Parameters:
listener- aReadyStateChangeListenerobject.
-
getAllResponseHeaders
getAllResponseHeaders.
- Returns:
- a
Stringobject.
-
getPostCharset
This is the charset used to post data provided to send. It returns "UTF-8" unless overridden.- Returns:
- a
Stringobject.
-
getReadyState
public int getReadyState()Getter for the field readyState.
- Returns:
- a
Integerobject.
-
getResponseBytes
public byte[] getResponseBytes()Getter for the field responseBytes.
- Returns:
- an array of
objects.
invalid reference
byte
-
getResponseHeader
getResponseHeader.
-
getResponseText
getResponseText.
- Returns:
- a
Stringobject.
-
getResponseXML
getResponseXML.
- Returns:
- a
Documentobject.
-
getStatus
public int getStatus()Getter for the field status.
- Returns:
- a
Integerobject.
-
getStatusText
Getter for the field statusText.
- Returns:
- a
Stringobject.
-
open
open.
- Parameters:
method- aStringobject.uri- aURLobject.asyncFlag- a boolean.userName- aStringobject.- Throws:
IOException- if any.Exception
-
open
open.
-
open
open.
-
open
open.
-
open
open.
-
open
open.
-
open
public void open(String method, String url, boolean async, String username, String password) throws Exception open.
-
open
public void open(String method, URI uri, boolean asyncFlag, String userName, String password) throws Exception Opens the request. Call send to complete it.- Parameters:
method- The request method.uri- The request URL.asyncFlag- Whether the request should be asynchronous.userName- The user name of the request (not supported.)password- The password of the request (not supported.)- Throws:
IOException- if any.Exception
-
send
Sends POST content, if any, and causes the request to proceed.In the case of asynchronous requests, a new thread is created.
- Parameters:
content- POST content or null if there's no such content.- Throws:
Exception- if any.
-