【发布时间】:2012-06-12 15:55:46
【问题描述】:
我正在尝试使用图形 api 运行 FQL。
$graph_url = "https://graph.facebook.com/fql?q=".$fql."&access_token=". $access_token;
$output = json_decode(file_get_contents($graph_url));
var_dump($output);
这会报错
[function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request
如果我将$graph_url 的内容复制并粘贴到浏览器中,我会得到预期的结果。所以,我确定我的 access_token 和 fql 查询是正确的。
另外,如果我尝试通过
$graph_url = "https://graph.facebook.com/me/?access_token=". $access_token;
$output = json_decode(file_get_contents($graph_url));
var_dump($output);
我没有收到任何错误,而是预期的结果。我不确定,我的 fql 查询中缺少什么。
【问题讨论】:
-
$fql的内容是什么?
标签: php facebook-graph-api facebook-fql facebook-php-sdk