2011-01-20 108 views
5

我正在實現Facebook圖形API以獲得用戶詳細信息,如名字,電子郵件等。Facebook圖形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 

任何人都可以請幫助我。

感謝, 阿圖爾

+0

您能否請格式化代碼以便閱讀?謝謝 – Bartek 2011-01-24 20:00:55

回答

8

訪問令牌應該使用GET方法傳遞,無法發佈。只需將其附加到您的網址,它應該工作得很好!

+1

感謝這個問題已經排序 – Atul 2011-01-27 06:23:32