0

I make GET - http request and in most TVs, which I test, everything is fine, but I have some TVs that they display "NETWORK ERROR". Of course the TVs are connected to the network and the server is working (meaning the URL is correct. Is exactly the same code in all TV sets in any case). The strangest thing is that these TVs (with the error) have access to the Internet, e.g. YouTube works well.

 function httpGet(theUrl)
                  {
                      var xmlHttp = new XMLHttpRequest();
                      xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
                      xmlHttp.send( null );                      
                  }

I don't care for the xmlHttp.responseText

I tried hard reset with no luck.

Kevin
  • 85
  • 7

1 Answers1

1

The approach using:

    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
        // callback function implementation
    };
    xmlhttp.open("GET", url, true);
    xmlhttp.send();

always works for us. Perhaps some browser security feature is blocking you, such as CORS or XSS or HTTPS or ...? You can try downloading a static image from the same origin to confirm.

  • Might be something like I get hit with on the Vestel (Opera TV) models I deal with. The TV Checks it's online presence by repeatedly checking an external URL for a 2k text file, if at any point it can't retrieve said file, it switches to offline mode (And keeps checking), which as a result even though the physical ethernet cable is in and has an IP the set will remain convinced it has no connection and refuse to do anything that needs network support. In my case, I run a local webserver and DNS redirection so it get's the file locally. – shawty Feb 27 '23 at 17:07