You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • As @DrAzzy says, the most simple, hacky way to send data is (for example to send temperature):

    require("http").get("http://www.mysite.com?temp="+E.getTemperature(), function(res) {
      var contents = "";
      res.on('data', function(data) { contents += data; });
      res.on('close', function() { console.log("Done! Got "+contents); });
    });
    

    Ideally you would use HTTP POST to stop accidental puts of data by web crawlers, in which case you could do:

    function sendData() {
      var options = {
        host: 'mysite.com',
        port: '80',
        path:"pageName?temp="+E.getTemperature(),
        method:'POST'
      };
      require("http").request(options, function(res)  {
        var d = "";
        res.on('data', function(data) { d+=data; });
        res.on('close', function(data) {
          console.log("Done! Got "+d);
        });
     }).end();
    }
    
About

Avatar for Gordon @Gordon started