【发布时间】:2015-05-29 09:12:59
【问题描述】:
当我在浏览器中点击 URL https://api.instagram.com/oauth/authorize/?client_id=&redirect_uri=http://localhost/Instagram_flow/result.php&response_type=code&scope=basic+comments+relationships+likes 时,我得到的响应是:
{"code": 400, "error_type": "OAuthException", "error_message": "您必须包含有效的 client_id、response_type 和 redirect_uri 参数"}
但是当我在这个 URL 上做一个 cURL 时:
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.instagram.com/oauth/authorize/?client_id=&redirect_uri=http://localhost/Instagram_flow/result.php&response_type=code&scope=basic+comments+relationships+likes');
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json'));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($curl);
echo $data;
curl_close($curl);
它什么也不返回。我也在 Postman 中点击了这个 URL,它也给出了 JSON 响应。
【问题讨论】:
标签: php json curl oauth-2.0 instagram-api