Cosm HTTP Out Example Returns 411 (Length Required)

The sample code in the Agent Guide (http.put to Cosm) returns status code 411 (Length Required). Adding “Content-Length”: “2” to the header section does not help (value = “68”). When I use the same parameters on hurl.it it works like a charm.

device.on("temperature update", function(value) { local req = http.put("http://api.cosm.com/v2/feeds/77185/datastreams/foo.csv", { "Content-Type": "text/csv" }, value) req.sendasync(function(response) { device.send("success", response.statuscode); }); });

That’s a bug, indeed probably a regression. I’ll look into it, thanks!

Peter

Ah yes. This was a bug, sorry. The fix is in test and should be pushed shortly.

Peter

Peter, thank you!!!