我有传入数据,我存储在变量消息:
connection = ContextIO::Connection.new(key, secret) messages = connection.all_messages(:account => account, :limit => 100, :since => (Time.now - 3000.day ))变量 messages 的格式为JSON.然后我执行这个:
foo = JSON.parse(messages)['data']大多数时候这个工作.每次都会收到此错误消息:
A JSON text must at least contain two octets!那个错误消息指向 JSON.parse(messages)['data']
谢谢!