parse.com-php-library icon indicating copy to clipboard operation
parse.com-php-library copied to clipboard

PHP Fatal error: Class 'parseRestClient'

Open atkinja opened this issue 11 years ago • 7 comments

Hey team

I am getting this: PHP Fatal error: Class 'parseRestClient'

Just testing out by creating an object and here is the code:

atkinja avatar Oct 07 '13 23:10 atkinja

getting the same issue.

ninjaphuah avatar Oct 10 '13 22:10 ninjaphuah

Yeah so I have skipped this route and just running curl from inside my PHP code using CURLOPT, something like this

error_reporting(-1); ini_set('display_errors', true); $handle = curl_init(); $url = "https://api.parse.com/1/classes/myClass"; $headers = array ( "Content-Type: application/json", "X-Parse-Application-Id: APPID", "X-Parse-REST-API-Key: RESTID" );

curl_setopt($handle, CURLOPT_URL, $url); curl_setopt($handle, CURLOPT_HTTPHEADER, $headers); curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); curl_setopt($handle, CURLOPT_POST, true); curl_setopt($handle, CURLOPT_HTTPGET, true);

$response = curl_exec($handle);

print "$response"; ///

atkinja avatar Oct 10 '13 22:10 atkinja

The parseRestClient class is located in the parse.php file. You have to include it in your script. If you include it you don't need to include parseConfig.php because all parse library files are included in parse.php

SinanEker avatar Oct 11 '13 14:10 SinanEker

It looks like the problem lies with header name and the class name don't match and it is required by some of the MVC framework.

ninjaphuah avatar Oct 15 '13 21:10 ninjaphuah

I am following atkinja's method and works well but I want to know what if I need some specific data with particular key. Is it possible to do so? I need all records which are having a particular id in it.

iliyaskhan avatar Apr 11 '14 11:04 iliyaskhan

No, usually that error means there is something wrong with the server you are on. It should give you more of an error message, can you post that? On Apr 11, 2014 4:56 AM, "iliyaskhan" [email protected] wrote:

I am following atkinja's method and works well but I want to know what if I need some specific data with particular key. Is it possible to do so? I need all records which are having a particular id in it.

— Reply to this email directly or view it on GitHubhttps://github.com/apotropaic/parse.com-php-library/issues/114#issuecomment-40195877 .

andrewscofield avatar Apr 11 '14 15:04 andrewscofield

parseRestClient class are on file parse.php, include to on your project.

NandoSantana avatar Feb 13 '15 12:02 NandoSantana