I am trying to get the Spark Core to communicate with my website by sending a GET request to a specific page. So far the closest I got was with this tutorial:
But the sample code does not seem to include anything about reading the response returned by the target page. How should I go about it? Where can I find detailed documentation/examples about how to use the "client" object?
Also, consider trying out the search function on the forums. If you type in “http” you get an abundance of posts concerning this very topic. There’s even an HTTP library, should you be interested.
But hit a wall immediately. After installing Node.js, I tried “$ npm install -g particle-cli” as instructed and got this:
SyntaxError: Unexpected identifier
at Object.exports.createScript (vm.js:44:10)
at REPLServer.defaultEval (repl.js:117:23)
at bound (domain.js:254:14)
at REPLServer.runBound [as eval] (domain.js:267:12)
at REPLServer.<anonymous> (repl.js:279:12)
at REPLServer.emit (events.js:107:17)
at REPLServer.Interface._onLine (readline.js:214:10)
at REPLServer.Interface._line (readline.js:553:8)
at REPLServer.Interface._ttyWrite (readline.js:830:14)
at ReadStream.onkeypress (readline.js:109:10)