Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. "private_key": "-----BEGIN PRIVATE KEY-----veryLongKey---END PRIVATE KEY-----n",
  2. "client_email": "randomemail@appspot.gserviceaccount.com",
  3.  
  4. $url = 'https://localhost-42d67.firebaseio.com/Devices.json?auth=' .$theCreatedToken;
  5. $arr = array("success" =>array("iPhone"=>500));
  6. $data_string = json_encode($arr);
  7. $ch = curl_init($url);
  8. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
  9. curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  12. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  13. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  14. 'Content-Type: application/json',
  15. 'Content-Length: ' . strlen($data_string))
  16. );
  17. echo $result = curl_exec($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement