public abstract class XMLHttpRequest extends java.lang.Object implements IHttpRequest
HttpRequest.execute(String, String, String, String...)
to perform HTTP request.HttpRequest
Modifier and Type | Class and Description |
---|---|
static class |
XMLHttpRequest.AjaxReadyState
The enumeration represents Ajax Ready State Code, such as "0", "1", "2", "3" and "4".
The enumeration has a method value(), which can return the "Ready State code" string format. The enumeration has a method text(), which can return the "Ready State text" string format. |
IHttpRequest.HttpCommand, IHttpRequest.HttpHeader, IHttpRequest.HttpResponseStatus, IHttpRequest.Key
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VARIABLE_READY_STATE
'XMLHttpRequest_readyState', used as a javascript global variable 'window.XMLHttpRequest_readyState' to store the ajax's 'readyState' value
|
static java.lang.String |
VARIABLE_RESPONSE_HEADERS
'XMLHttpRequest_responseHeaders', used as a javascript global variable 'window.XMLHttpRequest_responseHeaders' to store the ajax's 'responseHeaders' value
|
static java.lang.String |
VARIABLE_RESPONSE_TEXT
'XMLHttpRequest_responseText', used as a javascript global variable 'window.XMLHttpRequest_responseText' to store the ajax's 'responseText' value
|
static java.lang.String |
VARIABLE_RESPONSE_XML
'XMLHttpRequest_responseXML', used as a javascript global variable 'window.XMLHttpRequest_responseXML' to store the ajax's 'responseXML' value
|
static java.lang.String |
VARIABLE_STATUS
'XMLHttpRequest_status', used as a javascript global variable 'window.XMLHttpRequest_status' to store the ajax's 'status' value
|
static java.lang.String |
VARIABLE_STATUS_TEXT
'XMLHttpRequest_statusText', used as a javascript global variable 'window.XMLHttpRequest_statusText' to store the ajax's 'statusText' value
|
Constructor and Description |
---|
XMLHttpRequest() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
execute(IHttpRequest.HttpCommand command,
java.lang.String url,
boolean async)
Send a HTTP Request and get the response from the server.
|
java.util.Map<java.lang.String,java.lang.Object> |
execute(IHttpRequest.HttpCommand command,
java.lang.String url,
boolean async,
java.util.Map<java.lang.String,java.lang.String> headers)
Send a HTTP Request and get the response from the server.
|
java.util.Map<java.lang.String,java.lang.Object> |
execute(IHttpRequest.HttpCommand command,
java.lang.String url,
boolean async,
java.lang.String data)
Send a HTTP Request and get the response from the server.
|
abstract java.lang.String |
getReadyState()
After AJAX executing HTTP request, call this method to get the value of
Key#READY_STATE . |
java.util.Map<java.lang.String,java.lang.Object> |
getURL(java.lang.String url)
Send a HTTP "GET" Request and get the response from the server synchronously.
|
java.util.Map<java.lang.String,java.lang.Object> |
getURL(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> headers)
Send a HTTP "GET" Request and get the response from the server synchronously.
|
java.util.Map<java.lang.String,java.lang.Object> |
postURL(java.lang.String url,
boolean async,
java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.String data)
Send a HTTP "POST" Request and get the response from the server.
|
java.util.Map<java.lang.String,java.lang.Object> |
postURL(java.lang.String url,
boolean async,
java.lang.String data)
Send a HTTP "POST" Request and get the response from the server.
|
java.util.Map<java.lang.String,java.lang.Object> |
postURL(java.lang.String url,
java.lang.String data)
Send a HTTP "POST" Request and get the response from the server synchronously.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute, getHttpStatus, getHttpStatusText, getResponseHeaders, getResponseText, getResponseXml
public static final java.lang.String VARIABLE_READY_STATE
public static final java.lang.String VARIABLE_RESPONSE_TEXT
public static final java.lang.String VARIABLE_RESPONSE_XML
public static final java.lang.String VARIABLE_STATUS
public static final java.lang.String VARIABLE_STATUS_TEXT
public static final java.lang.String VARIABLE_RESPONSE_HEADERS
public java.util.Map<java.lang.String,java.lang.Object> getURL(java.lang.String url) throws SAFSException
url
- String, the URL to requestIHttpRequest.execute(HttpCommand, String, boolean, Map, String)
SAFSException
#execute(HttpCommand, String, boolean, Map, String)}
public java.util.Map<java.lang.String,java.lang.Object> getURL(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> headers) throws SAFSException
url
- String, the URL to requestheaders
- MapIHttpRequest.execute(HttpCommand, String, boolean, Map, String)
SAFSException
#execute(HttpCommand, String, boolean, Map, String)}
public java.util.Map<java.lang.String,java.lang.Object> postURL(java.lang.String url, java.lang.String data) throws SAFSException
url
- String, the URL to requestdata
- String, the data to send with the request.IHttpRequest.execute(HttpCommand, String, boolean, Map, String)
SAFSException
#execute(HttpCommand, String, boolean, Map, String)}
public java.util.Map<java.lang.String,java.lang.Object> postURL(java.lang.String url, boolean async, java.lang.String data) throws SAFSException
url
- String, the URL to requestasync
- boolean, if the HTTP request will be executed asynchronouslydata
- String, the data to send with the request.IHttpRequest.execute(HttpCommand, String, boolean, Map, String)
SAFSException
#execute(HttpCommand, String, boolean, Map, String)}
public java.util.Map<java.lang.String,java.lang.Object> postURL(java.lang.String url, boolean async, java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String data) throws SAFSException
url
- String, the URL to requestasync
- boolean, if the HTTP request will be executed asynchronouslyheaders
- Mapdata
- String, the data to send with the request.IHttpRequest.execute(HttpCommand, String, boolean, Map, String)
SAFSException
#execute(HttpCommand, String, boolean, Map, String)}
public java.util.Map<java.lang.String,java.lang.Object> execute(IHttpRequest.HttpCommand command, java.lang.String url, boolean async) throws SAFSException
command
- CommandHttp, the method to execute, such as 'GET', 'POST', 'PUT' etc.url
- String, the URL to requestasync
- boolean, if the HTTP request will be executed asynchronouslyIHttpRequest.execute(HttpCommand, String, boolean, Map, String)
SAFSException
#execute(HttpCommand, String, boolean, Map, String)}
public java.util.Map<java.lang.String,java.lang.Object> execute(IHttpRequest.HttpCommand command, java.lang.String url, boolean async, java.util.Map<java.lang.String,java.lang.String> headers) throws SAFSException
command
- CommandHttp, the method to execute, such as 'GET', 'POST', 'PUT' etc.url
- String, the URL to requestasync
- boolean, if the HTTP request will be executed asynchronouslyheaders
- MapIHttpRequest.execute(HttpCommand, String, boolean, Map, String)
SAFSException
#execute(HttpCommand, String, boolean, Map, String)}
public java.util.Map<java.lang.String,java.lang.Object> execute(IHttpRequest.HttpCommand command, java.lang.String url, boolean async, java.lang.String data) throws SAFSException
command
- CommandHttp, the method to execute, such as 'GET', 'POST', 'PUT' etc.url
- String, the URL to requestasync
- boolean, if the HTTP request will be executed asynchronouslydata
- String, the data to send with the request.IHttpRequest.execute(HttpCommand, String, boolean, Map, String)
SAFSException
#execute(HttpCommand, String, boolean, Map, String)}
public abstract java.lang.String getReadyState()
Key#READY_STATE
.
This is more useful for asynchronous execution, as synchronous execution the Map result contains this value.Key#READY_STATE
.IHttpRequest.execute(HttpCommand, String, boolean, Map, String)
Copyright © SAS Institute. All Rights Reserved.