美文网首页
使用Ruby 发送Restful Request (Patch)

使用Ruby 发送Restful Request (Patch)

作者: KidneyBro | 来源:发表于2019-02-01 16:40 被阅读0次

这里以PATCH操作为例,给出发送Restful Request的方法。

require 'rest-client'
require 'json'

url = "http://127.0.0.1/api/version/sources/source_name"

update_params = {"key" => "value"}
response = RestClient::Request.execute(:method => :patch, :url => url, :timeout => 10,  :open_timeout => 10, :payload => update_params.to_json)

参考链接
GitHub: Ruby Rest-Client Package

相关文章

网友评论

      本文标题:使用Ruby 发送Restful Request (Patch)

      本文链接:https://www.haomeiwen.com/subject/buydsqtx.html