Package org.loboevolution.http
Class HttpRequest
- All Implemented Interfaces:
EventTarget
,ScriptableDelegate
,XMLHttpRequestEventTarget
- Direct Known Subclasses:
XMLHttpRequestImpl
HttpRequest class.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
abort.void
addReadyStateChangeListener.getAllResponseHeaders.protected String
This is the charset used to post data provided to send.int
Getter for the field readyState.byte[]
Getter for the field responseBytes.getResponseHeader
(String headerName) getResponseHeader.getResponseText.getResponseXML.int
Getter for the field status.Getter for the field statusText.void
open.void
open.void
open.void
open.void
open.void
open.void
open.void
Opens the request.void
Sends 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, setOntimeout
Methods inherited from class org.loboevolution.html.dom.nodeimpl.event.EventTargetImpl
addEventListener, addEventListener, dispatchEvent, dispatchEvent, getFunction, removeEventListener, removeEventListener
Methods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
- aReadyStateChangeListener
object.
-
getAllResponseHeaders
getAllResponseHeaders.
- Returns:
- a
String
object.
-
getPostCharset
This is the charset used to post data provided to send. It returns "UTF-8" unless overridden.- Returns:
- a
String
object.
-
getReadyState
public int getReadyState()Getter for the field readyState.
- Returns:
- a
Integer
object.
-
getResponseBytes
public byte[] getResponseBytes()Getter for the field responseBytes.
- Returns:
- an array of
invalid reference
byte
-
getResponseHeader
getResponseHeader.
-
getResponseText
getResponseText.
- Returns:
- a
String
object.
-
getResponseXML
getResponseXML.
- Returns:
- a
Document
object.
-
getStatus
public int getStatus()Getter for the field status.
- Returns:
- a
Integer
object.
-
getStatusText
Getter for the field statusText.
- Returns:
- a
String
object.
-
open
open.
- Parameters:
method
- aString
object.uri
- aURL
object.asyncFlag
- a boolean.userName
- aString
object.- 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.
-