Closed RepeaterCreeper closed 8 years ago
In API.class.php, add a var_dump to sendRequest (line 24), like this:
protected function sendRequest($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'authorization: Bearer '.$this->_apiKey //
));
$output = curl_exec($ch);
curl_close($ch);
var_dump($output); //this is the new addition
return $output;
}
This should allow better debugging. What is it showing now?
bool(false) bool(false)
Never mind I figured it out. I remembered that the API Wrapper I used didn't work either until my friend suggested I add this curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
. Finally it works. :)
Everything I do is being met with
Notice: Trying to get property of non-object in C:\xampp\htdocs\Clan Link\requests\ClashAPI\Clan.class.php on line 115
Checked:
As previously stated the CODE is the exact replica of the "Examples: clanInformation.php" even the location of the API.class.php is the same.