# Igniton designer getting error: "IOError: Connection refused: connect" when trying to do a get request to local express server

**URL:** <https://forum.inductiveautomation.com/t/igniton-designer-getting-error-ioerror-connection-refused-connect-when-trying-to-do-a-get-request-to-local-express-server/74028>\
**Category:** Ignition\
**Created:** [May 22, 2023, 3:24pm UTC](https://forum.inductiveautomation.com/t/igniton-designer-getting-error-ioerror-connection-refused-connect-when-trying-to-do-a-get-request-to-local-express-server/74028 "2023-05-22T15:24:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![corbin\_Lazarone](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@corbin\_Lazarone](https://forum.inductiveautomation.com/u/corbin_Lazarone)\
**Post date:** [May 22, 2023, 3:24pm UTC](https://forum.inductiveautomation.com/t/igniton-designer-getting-error-ioerror-connection-refused-connect-when-trying-to-do-a-get-request-to-local-express-server/74028/1 "2023-05-22T15:24:54Z")

</div>

When passing api endpoint through igniton HTTP binding, the request works and fills the table with data. However when I try to make the same request through python configure events I am getting the following error: IOError: Connection refused: connect. I have tested my endpoint in postman and get the correct data. So I am wondering why the endpoint works in the HTTP binding but not in the python configure events?

Here is a screenshot of what the python script looks like:

 ![test](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad9c96bf583061012bca149838b3bc0664be0362.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 22, 2023, 3:30pm UTC](https://forum.inductiveautomation.com/t/igniton-designer-getting-error-ioerror-connection-refused-connect-when-trying-to-do-a-get-request-to-local-express-server/74028/2 "2023-05-22T15:30:38Z")

</div>

Don't use `httpGet`. It and the other legacy functions have many problems with modern APIs. Try with `httpClient` instead. (You should cache the `httpClient` instance in a project script library for best results.)

---

<div class="post-metadata">

**Author:** ![corbin\_Lazarone](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@corbin\_Lazarone](https://forum.inductiveautomation.com/u/corbin_Lazarone)\
**Post date:** [May 22, 2023, 3:44pm UTC](https://forum.inductiveautomation.com/t/igniton-designer-getting-error-ioerror-connection-refused-connect-when-trying-to-do-a-get-request-to-local-express-server/74028/3 "2023-05-22T15:44:33Z")

</div>

I tried the httpClient in the project script library but still am getting the following error: "java.io.IOException: java.io.IOException: Unable to GET [http://localhost:8000/get](http://localhost:8000/get)". When running in the script console.

Here is my code:

 ![test2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/4/744764bdb92b778379bb386a5dfa2b6d5db4f4de.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 22, 2023, 3:56pm UTC](https://forum.inductiveautomation.com/t/igniton-designer-getting-error-ioerror-connection-refused-connect-when-trying-to-do-a-get-request-to-local-express-server/74028/4 "2023-05-22T15:56:18Z")

</div>

Don't use the script console to test gateway scope scripts. The script console runs in your designer, not it the gateway's process.

{ Project library scripts do not have their own scope--they use their caller's scope. }
