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 it works like a charm.

device.on("temperature update", function(value) { local req = http.put("", { "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!


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


Peter, thank you!!!