这是我的文件:http://example.com/test.txt http://example.com/test.txt
我必须阅读以下内容http://example.com/test.txt http://example.com/test.txt(一个 JSON 字符串)并在 Ruby 中解析它
我建议使用open-uri http://www.ruby-doc.org/stdlib-1.9.2/libdoc/open-uri/rdoc/OpenURI.html:
require 'json'
require 'open-uri'
result = JSON.parse open('http://example.com/data.json').read
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)