HTTP Post Error Code


I’m trying to post some data to an Azure Event hub via HTTP. Should be straight forward but I must be missing something. I can successfully PSOT via Java Script. Here is the code. I keep getting an Status code of 6. Any Ideas ?

`// Setups
const URI = “”;
local HDRS = { “Content-Type”:“application/atom+xml;type=entry;charset=utf-8”,“Authorization” : “SharedAccessSignature”};

function HttpPostWrapper (url, headers, string) {

local request =, headers, http.jsonencode(string));
server.log("JSON string " +string);
local response = request.sendsync();

server.log("Code: " + response.statuscode + ". Message: " + response.body)
return response;


server.log("Data Point " + datapoint.temp);
server.log("Data PointID ";

local POST = “{TEMP :” + datapoint.temp +"}";

server.log("HTTP Post Response " + HttpPostWrapper(URI,HDRS,POST));


Error codes < 100 are lib cURL error codes, and Error Code 6 corresponds to “Couldn’t resolve host”

Have you double (and triple) checked the URI is indeed correct?

You likely need to add the http:// or https:// prefix to the URI?

thanks beardedinventor and Hugo

That was it. I missed a character in the URI when cutting and pasting. Its always something simple.

Working now