canvas.httpdataprovider.abortLoadForRequest( this.dataRequest ); return this.dataRequest.responseheaders; // TODO: [20080825 anba] Possibly deprecate and remove, see TODO below in 'getResponseHeader()' Debug.deprecated(this, 'getResponseHeaders', getResponseHeader); return this.getResponseHeader(hname); return this.dataRequest.responseheaders[hname]; // Currently raw text response is only available for serverless requests this.responseText = this.dataRequest['rawdata']; this.responseXML = this.dataRequest.xmldata; this.status = 200; // maybe we need something a little more Laszlo-specific? this.statusText = "OK"; this.setAttribute('readyState', 4); // 'receiving' (well, received...) if (this.onreadystatechange != null) { this.onreadystatechange(this); } = 0) { var code = err.substring(ind+(marker.length), ind+(marker.length)+3); this.status = Number(code); this.statusText = err.substring(ind+4+(marker.length)); } } else { // serverless mode gives us basically no info on what happened, so fake it this.status = 500; // this.statusText = "Error"; } this.setAttribute('readyState', 4); // 'receiving' (well, received...) if (this.onreadystatechange != null) { this.onreadystatechange(this); } ]]> if (this.headers == null) { this.headers = new LzParam(); } this.headers.setValue(key, val); An implementation of XMLHttpRequest (also called "AJAX") for compatibility in SWF runtimes

This class implements the XMLHTTPRequest as specified by the WHATWG consortium.

In SOLO deployed applications, this class departs from the specification in these ways:

  • Cannot set HTTP headers
  • Cannot access response headers
  • Cannot send raw POST data
  • Cannot send repeated query args in a POST using LoadVars
  • Username/password Auth args to send() not supported
<script> function loadXMLDoc(url) { var req = new lz.XMLHttpRequest(); req.onreadystatechange = processReqChange; req.open("GET", url, true); req.setRequestHeader('X-Test', 'one'); req.setRequestHeader('X-Test', 'two'); req.send(null); } function processReqChange(request) { Debug.debug("processReqChange: req.readyState %w", request.readyState); // only if request shows "loaded" if (request.readyState == 4) { // only if "OK" if (request.status == 200) { Debug.debug("arg = %w", request); Debug.debug("request.status: %w", request.status); Debug.debug("request.responseText: %w", request.responseText); Debug.debug("request.responseXML %w:", request.responseXML); Debug.debug("request.getAllResponseaders:", request.getAllResponseHeaders()); } else { Debug.debug("There was a problem retrieving the XML data: %w\n", request.statusText); } } } </script>