0

Simple http GET fails

I'm using the free standalone version 3.15.6 on MacOS Sequoia.  I put the following code snippet into a button:

let response := http("GET", "http://localhost:8000");
if response.error then
    alert("Error fetching GPS data: " + response.error)
else
    this.(Position := response)
end

I have a python script that reads a GPS dongle and posts it to http://localhost:8000. It works fine. Here is the output of the python script when it's running and the the webpage is refreshed in a browser:

{"latitude": 91.265015166666664, "longitude": -181.40945833333333}

Yes, I know lat 91 and lon 181 don't exist.  I changed them for this post.

The Ninox script should get the output of the python script via http and put it into the "Position" field on the form when the button is clicked.  It doesn't.  I get the error alert instead:

"Error fetching GPS data: Request has failed: error -"

So what am I doing wrong?

Reply

null

Content aside

  • 2 days agoLast active
  • 16Views
  • 1 Following