restfb 获取对象
restfb Fetching Object
我今天刚用过restfb,我用restfb写了一些demo应用。但是新的 api 版本 1.30 与文档不匹配。
在Documentation中,Fetching对象是这样写的..
Page page = facebookClient.fetchObject("cocacola", Page.class);
但是新版本是我只能这样写...
Page page = client.fetchObject("cocacola", Page.class,Parameter.with("fields", "name,id"));
使用参数获取可能会更快,但我想从 facebook 页面获取所有数据。我不想处理特定参数,因为如果我需要更多参数,我必须编写更多。我想从页面中获取所有数据。那么,有什么建议吗?
让我引用restfb文档:
Facebook made a breaking change with Graph API 2.4 and you now have to provide the fields parameter to get the fields you need. According to Facebook, reducing the default fields leads to faster performance. In the Advanced Usage section you'll find a example how the fields are requested with RestFB.
我今天刚用过restfb,我用restfb写了一些demo应用。但是新的 api 版本 1.30 与文档不匹配。
在Documentation中,Fetching对象是这样写的..
Page page = facebookClient.fetchObject("cocacola", Page.class);
但是新版本是我只能这样写...
Page page = client.fetchObject("cocacola", Page.class,Parameter.with("fields", "name,id"));
使用参数获取可能会更快,但我想从 facebook 页面获取所有数据。我不想处理特定参数,因为如果我需要更多参数,我必须编写更多。我想从页面中获取所有数据。那么,有什么建议吗?
让我引用restfb文档:
Facebook made a breaking change with Graph API 2.4 and you now have to provide the fields parameter to get the fields you need. According to Facebook, reducing the default fields leads to faster performance. In the Advanced Usage section you'll find a example how the fields are requested with RestFB.