Facebook 图形 API 错误
我正在实现 facebook graph api 来获取用户详细信息,例如名字、电子邮件等,
下面是我的代码。
$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);
但我收到以下错误
"type":"GraphMethodException","message":"Unsupported post request."}}1
有人可以帮助我吗?
谢谢, 阿图尔
I am implementing facebook graph api to get the user details such as firstname, email etc.
below is my code.
$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
Can anyone please help me out.
Thanks,
Atul
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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!