将Json解析的字符串还原为Json

这个问题在这里已经有了答案:

  • 安全地将JSON字符串转换为对象22个答案

  • require 'json'
    h = JSON.parse string
    

    这个链接对你有帮助..

    https://hackhands.com/ruby-read-json-file-hash/


    JSON.parse "{"user":{"email":"blah@blah.com","name":"blah Test 1051","mobile":"9999999999","dob":"00/00/0000","street":"somewhere","state":"something","city":"nowhere","pincode":"50000","Event_Code":"e0031"}}"
    

    检查http://apidock.com/ruby/JSON/parse以获取更多参考

    链接地址: http://www.djcxy.com/p/31729.html

    上一篇: Revert a Json parsed string to Json

    下一篇: jQuery: get order id from json response