为什么我可以使用https://developers.facebook.com/tools/explorer/使用此网址正确发布:
https://graph.facebook.com/me/og.likes?object=http://guidepal.com/escape/30?access_token=xxx
其中xxx是有效的访问令牌,甚至用
确认https://developers.facebook.com/tools/debug/
但是当我尝试直接在浏览器网址上使用它时,我得到了json响应:
{
"error": {
"message": "An active access token must be used to query information about the current user.",
"type": "OAuthException",
"code": 2500
}
}
我猜这是因为它不是一个正确的POST请求。但我尝试使用hurl.it并且它没有用,尝试使用我的代码用于iPhone应用程序并且仍然是相同的响应。 只有当我使用资源管理器工具时它才真正起作用。
为什么会这样?
答案 0 :(得分:1)
为什么我可以使用[...]这个网址正确发布:
https://graph.facebook.com/me/og.likes?object=http://guidepal.com/escape/30?access_token=xxx
我打赌你无法发布使用 very 的网址 - 因为查询字符串中的 name = value 对彼此分开您在网址中使用的&
,不第二个?
。
使用您的网址,您只需提供值为object
的{{1}}参数 - 因此难怪API会抱怨您没有提供access_token,因为有效您没有的