XMLHttp
Module | ejs.io |
Namespace | "ejs.io" |
Definition | class XMLHttp |
Specified | Ejs-11. |
Inheritance | XMLHttp ![]() |
XMLHttp compatible method to retrieve HTTP data.
Properties
Qualifiers | Property | Type | Description |
---|---|---|---|
public static const | Loaded | ReadyState values. | |
public static const | Open | ReadyState values. | |
public static const | Receiving | ReadyState values. | |
public static const | Sent | ReadyState values. | |
public static const | Uninitialized | ReadyState values. | |
public | onreadystatechange | Function | Call back function for when the HTTP state changes. |
XMLHttp Methods
Qualifiers | Method |
---|---|
public | abort(): Void |
Abort the connection. | |
public | getAllResponseHeaders(): String |
Return the response headers. | |
public | getResponseHeader(key: String) |
Return a response header. | |
public get | http(): Http |
Return the underlying Http object. | |
public | open(method: String, url: String, async: Boolean, user: String, password: String): Void |
Open a connection to the web server using the supplied URL and method. | |
public get | readyState(): Number |
Return the readystate value. | |
public get | responseBody(): String |
Not implemented. | |
public get | responseText(): String |
Return the HTTP response payload as text. | |
public get | responseXML(): XML |
Return the HTTP response payload as an XML document. | |
public | send(content: String): Void |
Send data with the request. | |
public | setRequestHeader(key: String, value: String): Void |
Set an HTTP header with the request. | |
public get | status(): Number |
Get the HTTP status code. | |
public get | statusText(): String |
Return the HTTP status code message. | |
XMLHttp() |
Method Detail
public abort(): Void
Abort the connection.
public getAllResponseHeaders(): String
Return the response headers.
- Returns
- A string with the headers catenated together.
public getResponseHeader(key: String)
Return a response header.
- Description
- Not yet implemented.
- Parameters
key: String The name of the response key to be returned.
- Returns
- The header value as a string.
get public http(): Http
Return the underlying Http object.
- Returns
- The Http object providing the implementation for XMLHttp.
- Specified
- Ejs-11.
Open a connection to the web server using the supplied URL and method.
- Parameters
method: String HTTP method to use. Valid methods include "GET", "POST", "PUT", "DELETE", "OPTIONS" and "TRACE" url: String URL to invoke async: Boolean If true, don't block after issuing the requeset. By defining an $onreadystatuschange callback function, the request progress can be monitored. [default: false] user: String Optional user name if authentication is required. password: String Optional password if authentication is required.
get public readyState(): Number
Return the readystate value.
- Description
- This value can be compared with the XMLHttp constants: Uninitialized, Open, Sent, Receiving or Loaded.
- Returns
- Returns a number with the value: Uninitialized = 0, Open = 1, Sent = 2, Receiving = 3, Loaded = 4.
get public responseBody(): String
Not implemented.
- Description
- Only for ActiveX on IE.
get public responseText(): String
Return the HTTP response payload as text.
- Returns
- Returns a string containing the HTTP request response data.
get public responseXML(): XML
Return the HTTP response payload as an XML document.
- Returns
- Returns an XML object that is the root of the HTTP request response data.
Send data with the request.
- Parameters
content: String Data to send with the request.
get public status(): Number
Get the HTTP status code.
- Returns
- A status code between 100 and 600. See $Http for the status code constants.
get public statusText(): String
Return the HTTP status code message.
- Returns
- A string containing the status message returned by the web server.
XMLHttp()