instantreality 1.0

XMLHttpRequest

The XMLHttpRequest object can be used to communicate with services that use HTTP based protocols.

See http://www.w3.org/TR/XMLHttpRequest/ for further description. A connection via Http is only allowed when the Context parameter ecmaScriptXHRTrustedHosts is set to Hostname. Hostname can be a comma seperated list of alloed hosts or the keyword any to disable this host check. You can set this Context parameter by adding can be set by adding --ecmaScriptXHRTrustedHosts to your commandline.

Properties

TypePropertyDescriptionStandard
numberstatus

http response status number [read]

Avalon
StringstatusText

http response status text [read]

Avalon
StringresponseText

http response body as String [read]

Avalon
ObjectresponseXML

http response body as XML Object [read]

Avalon
numberreadyState

XMLHttpResponse status number [read].

Avalon
callbackonreadystatechange

callback function for asynchronous requests [write]

Avalon

Functions

Return typeFunctionDescriptionStandard
voidopen(String method, String url, Boolean async)

Prepares a new http request.

.open('GET','http://localhost/sometext.txt) can be used to get the file sometext.txt from the host localhost. The flag async is used to send asynchronous requests. In that case a callbackfunction must be set with .

Avalon
StringsetRequestHeader(String header, String value)

Adds header with value value to the request header.

.setRequestHeader('User-Agent','SomeBrowser') can be used to set the Header User-Agent to the value SomeBrowser.

Avalon
Stringsend(String ConvertType)

Stringabort()

aborts an running asynchronous request.

Avalon
StringgetResponseHeader(String header)

Returns the value of header

Avalon
StringgetAllResponseHeaders()

Returns the value of all headers.

Avalon