使用Ruby代码执行HTTP修补程序

使用Ruby代码执行HTTP修补程序,ruby,rest,curl,curb,Ruby,Rest,Curl,Curb,我正在尝试使用路缘做一个HTTP补丁。通过查看代码,似乎没有为此而公开的方法。有没有办法用路缘做补丁?如果没有,Ruby中还有哪些库或方法可以实现这一点?最新版本(v0.8.1)支持补丁,即使它在Curl::Easy界面中没有明确可用(请参见lib/Curl/Easy.rb) 您可以找到快捷方式方法: 使用它,您可以执行以下补丁请求: curl = Curl.patch("http://www.example.com/baz", {:foo => "bar"}) curl = Curl:

我正在尝试使用路缘做一个HTTP补丁。通过查看代码,似乎没有为此而公开的方法。有没有办法用路缘做补丁?如果没有,Ruby中还有哪些库或方法可以实现这一点?

最新版本(v0.8.1)支持
补丁
,即使它在
Curl::Easy
界面中没有明确可用(请参见
lib/Curl/Easy.rb

您可以找到快捷方式方法:

使用它,您可以执行以下
补丁
请求:

curl = Curl.patch("http://www.example.com/baz", {:foo => "bar"})
curl = Curl::Easy.new(url)

# `http` is a method implemented within the C extensions of curb
# see `ruby_curl_easy_perform_verb_str`. It allows to set the HTTP
# verb by calling `curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, verb)`
# and perform the request right after
curl.http(:PATCH)
在引擎盖下,
补丁
动词被简单地传递到easy界面,如下所示:

curl = Curl.patch("http://www.example.com/baz", {:foo => "bar"})
curl = Curl::Easy.new(url)

# `http` is a method implemented within the C extensions of curb
# see `ruby_curl_easy_perform_verb_str`. It allows to set the HTTP
# verb by calling `curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, verb)`
# and perform the request right after
curl.http(:PATCH)