Hi
I’m developing an extension to call an http service. I’ve been looking at the source of the gsheet extension and I came up with a sprite extension and blocks having something like this in them:
var oReq = new XMLHttpRequest;
oReq.open("GET", "http://127.0.0.1:8001/land");
oReq.onreadystatechange = function () {
if (4 == oReq.readyState && 200 == oReq.status)
app.log("received: " + oReq.responseText);
}
oReq.send();
this works in the preview but if I download the mext and run it from mblock (mac) I get “TypeError: Cannot read property ‘remote’ of undefined”
I assume the reason might be in something wrong with the http request but what is the correct way to call an external service?
Regards
Virgilio