这是我从控制器中的api获得的json响应。
[{"TId":"5","TType":"test","TLocation":"Boston","TDesc":"Time in Boston","TDate":"2014-03-10 15:54:44","TStatus":"Go","TRemarks":"None"},{"TId":"6","TType":"test","TLocation":"New York","TDesc":"Time in New York","TDate":"2014-03-10 16:48:39","TStatus":"Go","TRemarks":"None"}]
我想在单独的字段中显示这些数据:
TId:"value", TType:"value", TLocation:"value", TDesc:"value", TDate:"value", TStatus:"value", TRemarks:"value"
这就是我获得json的方式:
result = JSON.parse(open("https://myapi.com/test", {:ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE, :http_basic_authentication=>['uname', 'upassword']}).read)
PS:OP是JSON的新手