httpClient post works from local script console but not from gw script console. Unable to POST

I'm trying to use 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 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:

Message: Unable to POST
Traceback (most recent call last):
  File "<input>", line 4, in <module>
  File "<module:shared.gateway.diag>", line 298, in writeMetricsToDataDog
IOException: Unable to POST

This is the crux of the script:

api_url = ''
headers = {'Accept': 'application/json', 'Content-Type': "application/json", 'DD-API-KEY': api_key}
data = {"series": datapoints}
data = system.util.jsonEncode(data)
LN 297: http =
LN 298: response =, data=data, headers=headers)

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

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