Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // create curl resource
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_POST, 1);
- // set url
- curl_setopt($ch, CURLOPT_URL, "https://api.spark.io/v1/devices/YOURDEVICEIDHERE/led");
- // set oauth access token
- curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('access_token' => 'YOURACCESSTOKENHERE')));
- // return the transfer as a string
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- // $output contains the output string
- $output = curl_exec($ch);
- print_r($output);
- // close curl resource to free up system resources
- curl_close($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement