Facebook帖子例外:(#100)链接网址格式不正确

时间:2012-01-24 13:58:25

标签: facebook facebook-graph-api

当我尝试通过我的FBApp发布在墙上时,我收到此错误。在当地主机上一切都很好。这是我的代码示例。

$facebook = new Facebook(array(  
 'appId'  => API_KEY,
 'secret' => API_SECRET,
 'cookie' => true,
));

$args = array(
      'message' => $_SESSION['fields']['message'],
      'name' => 'Look at POSTCARD',
      'caption' => $context['ProjectName'],
      'link' => $data['view_url']."&s=".$hash,
      'description' => 'We are a lifestyle community with hotel services in the heart of San Francisco,check us out and ask a question.',
      'picture' => $body_all["thumb"],
      'actions' => array(array('name' => 'SEND A POSTCARD',
                        'link' => FACEBOOK_ACTION_URL."?next_postcard_id=".$postcard_id))
      );

在此字符串处,异常PHP Fatal error: Uncaught OAuthException: (#100) link URL is not properly formatted正在抛出

$post_fb_id = $facebook->api("/me/feed/", "post", $args);

1 个答案:

答案 0 :(得分:-1)

Anton Sementsov 我不擅长PHP方面,但擅长Java!遇到同样的问题Code-100
使用APP_ACCESS_TOKEN并点击URL
https://graph.facebook.com/USER_ID/feed?access_token=APP_ACCESS_TOKEN&message=JustTest&link=http//domain/path/file.jsp

使用ApacheHTTP客户端点击URL,问题是如果参数传递给 [link] 在点击URL之前被编码,您将获得错误代码:100

如果在HIT之前对URL进行编码,则必须确保参数 link 的值不会被编码并以相同的UTF格式传递。