Using Parse.com and REST API. I am sending a PUT request in order to update a record.
$url = 'https://api.parse.com/1/classes/Language/lXn2Jr8g3D';
$headers = array(
"Content-Type: application/json",
"X-Parse-Application-Id: " . $appId,
"X-Parse-REST-API-Key: " . $apiKey ,
);
$objectData = '{"designation":"barfoo", "order":6}';
$rest = curl_init();
curl_setopt($rest,CURLOPT_URL,$url);
curl_setopt($rest,CURLOPT_PUT,1);
curl_setopt($rest,CURLOPT_POSTFIELDS,$objectData);
curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);
curl_setopt($rest,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($rest);
echo $response;
curl_close($rest);
This reports back
{"updatedAt":"2015-02-09T22:28:57.676Z"}
I see the record and I don't see the changes I requested. BUT the updatedAt field is really update. In fact this is the only thing that gets updated! If I ommit the objectId from the url and use POST instead of PUT, the insertion works just fine.