XMLHttp
Module | ejs.io |
Definition | class XMLHttp |
Inheritance | XMLHttp ![]() |
Stability | Prototype. |
XMLHttp compatible method to retrieve HTTP data This code is prototype and is not yet supported.
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. |
public get | http | Http | The underlying Http object. |
public get | readyState | Number | The readystate value. This value can be compared with the XMLHttp constants: Uninitialized, Open, Sent, Receiving or Loaded Set to: Uninitialized = 0, Open = 1, Sent = 2, Receiving = 3, Loaded = 4. |
public get | responseText | String | HTTP response body as a string. |
public get | responseXML | XML | HTTP response payload as an XML document. Set to an XML object that is the root of the HTTP request response data. |
public get | status | Number | The HTTP status code. Set to an integer Http status code between 100 and 600. |
public get | statusText | String | HTTP status code message. |
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 | open(method: String, url: String, async: Boolean = false , user: String = null , password: String = null): Void |
Open a connection to the web server using the supplied URL and method. | |
public | send(content: String): Void |
Send data with the request. | |
public | setRequestHeader(key: String, value: String): Void |
Set an HTTP header with the request. | |
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.
public open(method: String, url: String, async: Boolean = false , user: String = null , password: String = null): Void
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. NOTE: async mode is not supported. All calls will block. [default: false ] user: String Optional user name if authentication is required. [default: null ] password: String Optional password if authentication is required. [default: null]
Send data with the request.
- Parameters
content: String Data to send with the request.