4

我通过发布请求返回了这个 JSON 字符串,并且我正在使用 ruby​​ on rails:

{"a":[{"id":2816,"tr":990,"lub":"mattia1.lipreri","p":"0.20","b":"0"},{"id":2817,"tr":992,"lub":"mattia1.lipreri","p":"0.20","b":"0"},{"id":2818,"tr":993,"lub":"mattia1.lipreri","p":"0.20","b":"0"},{"id":2819,"tr":994,"lub":"mattia1.lipreri","p":"0.20","b":"0"},{"id":2820,"tr":995,"lub":"mattia1.lipreri","p":"0.20","b":"0"}]}

我想知道是否有办法压缩它,也许用 hpack 或 cjson,有什么提示吗?谢谢

4

2 回答 2

1

看看 bson gem:http ://rubygems.org/gems/bson 。它在内部用于 mongodb 驱动程序。

于 2012-12-11T08:53:51.027 回答