var options = {
host: 'example.com', // host name
port: 80, // (optional) port, defaults to 80
path: '/', // path sent to server
method: 'GET', // HTTP command sent to server (must be uppercase 'GET', 'POST', etc)
headers: { key : value, key : value } // (optional) HTTP headers
};
require("http").request(options, function(res) {
But where do I attach some JSON data (body/payload) to the POST request ?
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.
From espruino htttp reference:
But where do I attach some JSON data (body/payload) to the POST request ?