HTTP Post Error Code

Hello

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 = “ebus.windows.net/XXXXXX/publishers/admin/messages”;
local HDRS = { “Content-Type”:“application/atom+xml;type=entry;charset=utf-8”,“Authorization” : “SharedAccessSignature sr=https%3a%2f%2fkckevent-ns.servicebus.windows.net%2fkckevent%2fpublishers%2fadmin%2fmessages&sig=XXXXXXXXXXXXXXXXXXXXXXXXX=1421387108&skn=admin”};

function HttpPostWrapper (url, headers, string) {

local request = http.post(url, 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 " +datapoint.id);

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