23
Views
11
Comments
Call URL in Background
Question

I'am very new to outsystems platform. I have a URL, like this: http://192.168.55.109/TV1 which turns on the light in a room, this URL works when I execute it in a normal browser. But i want to open this url by clicking in a button. When i click a button i call this URL in background, without opening the browser. I tried with InAppBrowserPlugin, but when i click the button a external page opens. I just want to call this URL in background without open an browser, or opening an non-visible browser in the screen. Is that possible?

mvp_badge
MVP
Rank: #15

Hi Bruno,

You can try to use the action PostRequest_Submit from the extension HTTPRequestHandler.

Some documentation about it here.

Regards,

Marcelo

mvp_badge
MVP
Rank: #17

Hi Bruno,

That is a private IP address you try to reach. Are you able to reach that from your phone browser? If not that that will tell you why you cannot reach it from the mobile application either.

Private internal addresses are not routed on the Internet and no traffic cannot be sent to them from the Internet, they only supposed to work within the local network.
Private addresses include IP addresses from the following subnets:

  • A 192.168.0.0 to 192.168.255.255 range, which is a 192.168.0.0 network masked by 255.255.0.0 or /16

Regards,

Daniel

Maybe i can run an javascript code onclick button to call an url in a non visible page, but idk how to do that.


mvp_badge
MVP
Rank: #15

Hi Bruno,

Did you try the option I mention earlier?

Regards,

Marcelo

mvp_badge
MVP
Rank: #15

Found this maybe will help you

Im trying to do it with JavaScript, using AJAX calls, something like that: 

var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4 && xmlhttp.status==200) {
    var response = xmlhttp.responseText; //if you need to do something with the returned value
  }
}

xmlhttp.open("GET","http://192.168.55.109/TV1",true);
xmlhttp.send();

but isn't working.

mvp_badge
MVP
Rank: #15

That should work. You are getting any error?