Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "private_key": "-----BEGIN PRIVATE KEY-----veryLongKey---END PRIVATE KEY-----n",
- "client_email": "randomemail@appspot.gserviceaccount.com",
- $url = 'https://localhost-42d67.firebaseio.com/Devices.json?auth=' .$theCreatedToken;
- $arr = array("success" =>array("iPhone"=>500));
- $data_string = json_encode($arr);
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($data_string))
- );
- echo $result = curl_exec($ch);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement