How to send an HTTP requests to localhost from a perspective session?


So I have a development Flask application running on my local computer. I can reach it at or http://localhost:5000. Sending an HTTP request to this server from the script console works fine. When I put the exact same code into a button in a Perspective session it seems to route the request to the server Ignition is hosted on. This occurs in both the designer and in browser.

Is there a way to route it localhost on the host computer? I assume not, as it seems to be doing all the code logic server side.

Heres example code, if you need it.

client =
response ='')
# Validate the response
if response.good:
    # Do something with the response
    print response.text

You assumed correctly. All code is run on the server side.