itsgoingd / clockwork-chrome

Clockwork - php dev tools integrated to your browser - Chrome extension
https://underground.works/clockwork
411 stars 25 forks source link

Error loading request metadata. Server returned an error response. #76

Open salarmehr opened 5 years ago

salarmehr commented 5 years ago

It says "loading request metadata. returned an error response." How can I see the error itself?

// PHP page
<?php

require_once __DIR__.'/../vendor/autoload.php';

$clockwork = Clockwork\Support\Vanilla\Clockwork::init([ 'api' => '/temp/server.php' ]);
$clockwork->requestProcessed();

API endpoint

<?php

require_once __DIR__.'/../vendor/autoload.php';

$clockwork = Clockwork\Support\Vanilla\Clockwork::init();
$clockwork->returnMetadata();
salarmehr commented 5 years ago

The server.php returns null when I see it directly.

itsgoingd commented 5 years ago

Hey, the $clockwork->returnMetadata() method expects the request id in a "request" get parameter by default. This means you want your api endpoint set to /temp/server.php?request=, as Clockwork apps will append the requested id to the configured endpoint uri.

salarmehr commented 5 years ago

@itsgoingd thanks for your response. it still does not work

It says "loading request metadata. returned an error response." How can I see the error itself?

salarmehr commented 5 years ago

Do you have please a minimum working example? the minimal code in the client page and server page.

salarmehr commented 5 years ago

Would be great if you update the plugin to show the server error too instead of saying "Server returned an error response."

itsgoingd commented 5 years ago

I've published an example vanilla app here, let me know if it helps - https://github.com/underground-works/clockwork-examples/tree/master/Integrations/Vanilla-PHP