我正在使用 Facebook API,并且已经足够将访问令牌放入我的应用程序,但是当我实际向我的 Facebook 墙发送帖子时,我收到错误消息,{"error":{"message":"(#100) You can't post this because it has a blocked link.","type":"OAuthException","code":100}}1
我没有尝试发送任何类型的链接,只是“你好,世界!” 所以这对我来说似乎很奇怪:\这是我到目前为止的代码:
$content = urlencode("Hello, World!");
$accesstoken = urlencode($row['fbid']);
$result = getPageWithPOST("https://graph.facebook.com/me/feed", "access_token=" . $accesstoken . "&message=" . $content);
echo $result;
getPageWithPOST 在哪里,
function getPageWithPOST($url, $posts) {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $posts);
$content = curl_exec ($c);
curl_close ($c);
return $content;
}
谢谢!