0

我正在尝试代表用户在活动墙上发帖。我有 publish_stream 权限,但无法发出发布请求。

这不起作用:

$http.post("#{url}/#{id}/feed", {message: message, access_token: token})

但这些确实:

1)

$http.get("#{url}/#{id}/feed?method=POST&message=#{message}&access_token=#{token}")

2)

$http.post "#{url}/#{id}/feed?access_token=#{token}&message=#{message}"

知道为什么 Facebook API 会接受后者但拒绝 post 方法(就像 API 要求的那样)?我使用 $http.post 得到的错误是“此方法需要 access_token”

4

1 回答 1

0

I have limited idea about Facebook API but it seems that post method on $http is designed to send the data in the request body, whereas access token i think needs to be provided in querystring. post method would to parameter mapping for the url if the you provide it gets the same name token as here

$http.post("#{url}/#{id}/feed?access_token=#{token}&message=#{message}", {message: message, access_token: token})
于 2013-08-27T02:22:35.683 回答