Magento,curl_exec功能不起作用

时间:2015-09-08 08:31:27

标签: php curl

我正在使用magento进行Instagram登录,我的 curl_exec 没有在这里给我输出。我不知道我做了什么错误。

我的代码:

     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);

}

curl_exe 功能之前,我的$ch值为资源ID#814 ,但curl_exec()函数$jsondata变量返回空结果。

任何人都可以帮我解决这个问题吗? 提前谢谢。

0 个答案:

没有答案