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

**URL:** <https://forum.inductiveautomation.com/t/how-to-send-an-http-requests-to-localhost-from-a-perspective-session/52782>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 5, 2021, 3:28pm UTC](https://forum.inductiveautomation.com/t/how-to-send-an-http-requests-to-localhost-from-a-perspective-session/52782 "2021-11-05T15:28:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pandreoli](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@pandreoli](https://forum.inductiveautomation.com/u/pandreoli)\
**Post date:** [November 5, 2021, 3:28pm UTC](https://forum.inductiveautomation.com/t/how-to-send-an-http-requests-to-localhost-from-a-perspective-session/52782/1 "2021-11-05T15:28:54Z")

</div>

Hello,

So I have a development Flask application running on my local computer. I can reach it at [http://127.0.0.1:5000](http://127.0.0.1:5000) or [http://localhost:5000](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.

```auto
client = system.net.httpClient(bypass_cert_validation=True)
response = client.post('http://127.0.0.1:5000/ping')
# Validate the response
if response.good:
    # Do something with the response
    print response.text

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 5, 2021, 3:30pm UTC](https://forum.inductiveautomation.com/t/how-to-send-an-http-requests-to-localhost-from-a-perspective-session/52782/2 "2021-11-05T15:30:41Z")

</div>

> [@pandreoli](#):
>
> I assume not, as it seems to be doing all the code logic server side.

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