更改JSON格式
问题描述:
以下两页提供了相同的JSON对象。是否有可能为我的rails应用程序使用Facebook Style JSON格式?更改JSON格式
所需的格式:
https://graph.facebook.com/19292868552
我的应用程序格式:
http://sframework.heroku.com/api/graphs
感谢
以下两页提供了相同的JSON对象。是否有可能为我的rails应用程序使用Facebook Style JSON格式?更改JSON格式
所需的格式:
https://graph.facebook.com/19292868552
我的应用程序格式:
http://sframework.heroku.com/api/graphs
感谢
DEF索引 文件=打开( “https://graph.facebook.com/19292868552”) @message = JSON.pretty_generate(file.read) respond_with(@message) 端 – glarkou
这产生错误:2011-06-30T17:38:04 + 00:00 app [web.1]:JSON :: GeneratorError(仅允许生成JSON对象或数组): – glarkou
@ntenisOT您可能需要先解析Facebook结果成JSON对象类似JSON.parse(file.read) – bkaid