我将用Rails的命令替换我的命令行查询服务器
`curl -XPUT 'host:port/url' -d '{"val": "some_json"}'̀
,并得到结果......
某处这样的:
response = call('put', 'host:port/url', '{"val" : "some_json"}')
有任何预定义的方法来做到这一点在Rails或一些宝石? 我知道HTTP的命令get
,但我会做'PUT'方法。
Net::HTTP.get(URI.parse('host:port/url'))
感谢您的答复
你试过这样做吗? http://stackoverflow.com/questions/11403728/how-can-i-send-an-http-put-request-in-ruby – nicohvi