I am doing instagram login in magento, My curl_exec is not giving me the output here. I dont know what mistake i had done.
My code:
private function _makeOAuthCall($apiData) {
$apiHost = self::API_OAUTH_TOKEN_URL;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $apiHost);
curl_setopt($ch, CURLOPT_POST, count($apiData));
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($apiData));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo "<pre>";
echo "get test::::";
print_r($ch);
$jsonData = curl_exec($ch);
echo " gggg ";
print_r($jsonData); die;
curl_close($ch);
return json_decode($jsonData);
}
Before curl_exe function, I am getting $ch
value as Resource id #814, but the curl_exec()
functions $jsondata
variable return empty result.
Can anyone help me to fix this ? Thanks in advance.