You can use as:
var l := Browser.NewXMLHttpRequest as dynamic;
l.addEventListener(“load”, new WebAssemblyDelegate(() → begin WebAssembly.Global.alert(l.responseText); end));
l.open(“GET”, “/urlToGet”);
l.send();
In future builds we will update the imported methods for XmlHttpRequest and will be easier to use (CC friendly, …)
We updated DOM translation of XMLHttpRequest, using next public release you can use it this way:
var la := Browser.NewXMLHttpRequest;
la.onload := new WebAssemblyDelegate(() → begin WebAssembly.Global.alert(la.responseText); WebAssembly.Global.alert(la.responseURL); end);
la.open(“GET”, “/urlToGet”);
la.send();
The big advantage is you have now code completion help for all XMLHttpRequest members.