开发者

Facebook Graph API ERROR

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜