【问题标题】:Retrieve a post by id with RestFB API使用 RestFB API 按 id 检索帖子
【发布时间】:2014-09-04 06:39:15
【问题描述】:

我正在使用http://restfb.com/

我有一个帖子的 ID,我想检索它,但我找不到方法!我在网站的文档和谷歌上搜索,但似乎没有人有这个问题。

我试过了:

facebookClient.fetchObject(id, JsonObject.class);

但我收到此错误:

Can't retrive post: Received Facebook error response of type GraphMethodException: Unsupported get request.

【问题讨论】:

  • 响应 JSON 中返回什么代码?
  • 我不知道,这里是我的代码块:try{ return facebookClient.fetchObject(id, JsonObject.class); } catch (FacebookException e) { System.err.println("Can't retrive post: " + e.getMessage()); return null; }

标签: java facebook api post restfb


【解决方案1】:

试试下面的代码:

Post post = client.fetchObject(id, Post.class, Parameter.with("fields", "from,to,likes.summary(true),comments.summary(true)"));

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多