XMLHttp

Moduleejs.io
Definition class XMLHttp
InheritanceXMLHttp inherit Object
StabilityPrototype.

XMLHttp compatible method to retrieve HTTP data This code is prototype and is not yet supported.


Properties

QualifiersPropertyTypeDescription
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 onreadystatechangeFunctionCall back function for when the HTTP state changes.
public get httpHttpThe underlying Http object.
public get readyStateNumberThe 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 responseTextStringHTTP response body as a string.
public get responseXMLXMLHTTP response payload as an XML document. Set to an XML object that is the root of the HTTP request response data.
public get statusNumberThe HTTP status code. Set to an integer Http status code between 100 and 600.
public get statusTextStringHTTP status code message.

XMLHttp Methods

QualifiersMethod
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]

public send(content: String): Void

Send data with the request.

Parameters
content: String Data to send with the request.

public setRequestHeader(key: String, value: String): Void

Set an HTTP header with the request.

Parameters
key: String Key value for the header.
value: String Value of the header.
Example
setRequestHeader("Keep-Alive", "none")