# httpClient post works from local script console but not from gw script console. java.io.IOException Unable to POST

**URL:** <https://forum.inductiveautomation.com/t/httpclient-post-works-from-local-script-console-but-not-from-gw-script-console-java-io-ioexception-unable-to-post/80566>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [October 17, 2023, 2:29am UTC](https://forum.inductiveautomation.com/t/httpclient-post-works-from-local-script-console-but-not-from-gw-script-console-java-io-ioexception-unable-to-post/80566 "2023-10-17T02:29:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 17, 2023, 2:29am UTC](https://forum.inductiveautomation.com/t/httpclient-post-works-from-local-script-console-but-not-from-gw-script-console-java-io-ioexception-unable-to-post/80566/1 "2023-10-17T02:29:21Z")

</div>

I'm trying to use `system.net.httpClient` to post data to DataDog and have it working in my local laptop Designer in the script console (internet-connected) but it's not working in the Designer script console running directly on the GW, also internet-connected.  
I can access the datadog [POST url](https://api.datadoghq.com/api/v2/series) from a browser on the GW and it returns the same thing as in my local laptop browser.

This is the error I'm getting from the GW designer:

```auto
Cause: java.net.ConnectException
Message: Unable to POST https://api.datadoghq.com/api/v2/series
Traceback (most recent call last):
  File "<input>", line 4, in <module>
  File "<module:shared.gateway.diag>", line 298, in writeMetricsToDataDog
IOException: java.io.IOException: Unable to POST https://api.datadoghq.com/api/v2/series

```

This is the crux of the script:

```auto
api_url = 'https://api.datadoghq.com/api/v2/series'
headers = {'Accept': 'application/json', 'Content-Type': "application/json", 'DD-API-KEY': api_key}
data = {"series": datapoints}
data = system.util.jsonEncode(data)
...
LN 297: http = system.net.httpClient()
LN 298: response = http.post(url=api_url, data=data, headers=headers)

```

Edit:  
The Ignition service is running under a domain service account. I'm checking if it has internet access.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 17, 2023, 3:37am UTC](https://forum.inductiveautomation.com/t/httpclient-post-works-from-local-script-console-but-not-from-gw-script-console-java-io-ioexception-unable-to-post/80566/2 "2023-10-17T03:37:13Z")

</div>

Looks like it might be a proxy issue.

Edit: it _was_ a proxy issue. Had to pass the proxy server address into the httpClient function
