Facebook Graph API错误 [英] Facebook Graph API ERROR

查看:93
本文介绍了Facebook Graph API错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实现facebook graph api,以获取用户详细信息,例如名字,电子邮件等.

I am implementing facebook graph api to get the user details such as firstname, email etc.

下面是我的代码.

$nvpreq = "access_token=160370244010460|b8eba6c19f01b271ef0c682e-100000018108668|q50nk4_LpXvCdnpgiI-jyBPrzCM"; 

$Curl_Session = curl_init('https://graph.facebook.com/100001573561119');
curl_setopt ($Curl_Session, CURLOPT_POST, 1);
curl_setopt ($Curl_Session, CURLOPT_POSTFIELDS, $nvpreq);
curl_setopt ($Curl_Session, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$httpResponse = curl_exec ($Curl_Session);
curl_close ($Curl_Session); 

但是我收到以下错误消息

But i receive below error

"type":"GraphMethodException","message":"Unsupported post request."}}1 

有人可以帮我吗?

谢谢, 阿图尔

推荐答案

访问令牌应使用GET方法而不是POST传递.只需将其附加到您的URL,它就可以正常工作!

The access token should be passed using the GET method, not POST. Just append it to your URL and it should work fine!

这篇关于Facebook Graph API错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆