api - PHP put request with JSON -
i using parseapi (https://parse.com/docs/rest/guide#objects-updating-objects) , i'm attempting update object rest api. response parse saying object updated, no change made.
can please guide me in correct direction?
thank you!!
<?php $url = ' https://api.parse.com/1/classes/gamescore/ed1nuqpvcm'; $appid = 'my app id'; $restkey = 'my rest key'; $headers = array( "content-type: application/json", "x-parse-rest-api-key: " . $restkey, "x-parse-application-id: " . $appid ); $data = array('pass' => 'hi'); $jsondataencoded = json_encode($data); $ch = curl_init($url); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_customrequest, "put"); curl_setopt($ch,curlopt_httpheader,$headers); curl_setopt($ch, curlopt_postfields, http_build_query($jsondataencoded)); $response = curl_exec($ch); echo $response; ?>
Comments
Post a Comment