我需要做modrewrite以使其工作吗?

时间:2012-06-17 04:09:54

标签: php facebook-graph-api mod-rewrite

我正在使用facebook api。查看网站here上的文档。

查看您需要通过http post连接的示例:

https://graph.facebook.com/me/recipebox:cook?
recipe=http://www.example.com/pumpkinpie.html&access_token=YOUR_ACCESS_TOKEN

但是,在我的案例中,“食谱”(实际上是一个MLB游戏)有一个链接:

http://www.sportannica.com/team.php?team=New York Yankees&year=2012

我是否需要使用modrewrite使我的链接与facebook图表网址中的位置兼容?在URL中添加另一个问号有点混乱。

1 个答案:

答案 0 :(得分:1)

可能不是,请尝试在您为recipe参数传递的网址上使用urlencode

$recipeurl = 'http://www.sportannica.com/team.php?team=New York Yankees&year=2012';


$url = 'https://graph.facebook.com/me/recipebox:cook?recipe=' .
       urlencode($recipeurl) . '&access_token=1234';
相关问题