Author Topic: Can you use Curl on the Oak?  (Read 2083 times)

werner

  • Newbie
  • *
  • Posts: 37
Can you use Curl on the Oak?
« on: March 20, 2016, 12:42:58 am »
Very exited to hear that a stable version of Oak is now officially released.  I'll have to dig mine up and get playing again.

By the way, do anyone know if its possible to use Curl commands on an Oak.   I have an existing small app running on a RPi that sends SMS messages using Curl commands to server.   But if I can now port that to an Oak it would be so much cheaper, smaller and more elegant.

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Can you use Curl on the Oak?
« Reply #1 on: March 20, 2016, 01:58:40 am »
I'm only just beginning to understand how the JSON model works with Oak, but you can certainly interact with it via the Particle API using curl.

For POSTs (sending messages to Oak), you'd be after Particle.function() - docs here and here.

For GETs (receiving messages from Oak), you'd be after Particle.publish() - docs here and here.

Hope that helps, and hope to hear more about your project if it is successful ;)

jwhendy

  • Newbie
  • *
  • Posts: 44
Re: Can you use Curl on the Oak?
« Reply #2 on: March 21, 2016, 04:02:07 pm »
There's a tutorial on Particle.variable() for the oak here as well. If you go to the wiki there's also one on using Python for parsing the json response (not that you probably already don't know how if you're fiddling on a Pi!).