My REST API example:
var options = { protocol: "http:", method: 'POST', host: 'XXXX.XXXX.XXXX.XXXX', // Proxy IP path: 'https://endpoint.com/', // Landing URL port: 8888, pathname: "restpath", search: null, query: null, headers: { "Content-Type": "application/json", "Content-Length": content.length } }; var req = require("http").request(options, function (res) { var d = ""; res.on('data', function (data) { if (d.length < 8) d += data; }); res.on('close', function (data) { callback(); }); }); req.on('error', function (e) { callback(); }); req.end(content); } catch (f) { }
@Geza started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
My REST API example: