这里以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)