You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Just to add the fix for what you want is just the second example here:­

    require("http").get("http://www.espruino­.com", function(res) {
      var contents = "";
      res.on('data', function(data) { contents += data; });
      res.on('close', function() { console.log(contents); });

    basically get all the data, then parse in one go when the socket is closed


Avatar for Gordon @Gordon started