Skip to content

Cannot GET /parse (Bad Request) #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fraxool opened this issue Feb 1, 2016 · 2 comments
Closed

Cannot GET /parse (Bad Request) #126

fraxool opened this issue Feb 1, 2016 · 2 comments

Comments

@fraxool
Copy link

fraxool commented Feb 1, 2016

Hello,

I'm working on "connecting" my Parse PHP App to my parse-server and I get the error Bad Request. By printing the error message in the ParseClient.php class, I get Cannot GET /parse.

Here is my code to init my Parse configuration :

ParseClient::initialize( $app_id, $rest_key, $master_key ); 
ParseClient::setStorage( new ParseSessionStorage() );

// -- Check if the current user is logged in
$user = ParseUser::getCurrentUser();

if(!$user)
{
    if(isset($_GET["token"]))
    {       
        try {
            $user       = ParseUser::become($_GET["token"]);
        } catch(ParseException $ex) {
            // The Message "Bad Request" is shown here...
            print_r($ex->getMessage());
        }
    }
}

And in my ParseClient.php class, I have replaced the default hostname by mine :

const HOST_NAME = 'http://url.com:1337/parse';

But I always get this "Cannot GET /parse" error... Any idea?

Thanks,
Axel

EDIT : This issue can be closed. I fixed it and managed to make everything working by setting the HOST_NAME in my ParseClient.php file with the following :

const HOST_NAME = 'http://url.com:1337';

AND the API_VERSION with :

parse

... which finally appends "parse" to my parse-server URL.

@christianmarth
Copy link

Yes, that's correct, you need to set the HOST_NAME and API_VERSION constants as per

http://parseplatform.github.io/parse-php-sdk/classes/Parse.ParseClient.html#constant_HOST_NAME

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

I need to update the PHP SDK to allow for this... My bad. Follow on in #124. Thanks.

@gfosco gfosco closed this as completed Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants