类 Net::HTTP::Patch
用于表示 HTTP 方法 PATCH 的类
require 'net/http' uri = URI('http://example.com') hostname = uri.hostname # => "example.com" uri.path = '/posts' req = Net::HTTP::Patch.new(uri) # => #<Net::HTTP::Patch PATCH> req.body = '{"title": "foo","body": "bar","userId": 1}' req.content_type = 'application/json' res = Net::HTTP.start(hostname) do |http| http.request(req) end
参见 请求头.
属性
相关
-
Net::HTTP#patch
:发送PATCH
请求,返回响应对象。
常量
- METHOD
- REQUEST_HAS_BODY
- RESPONSE_HAS_BODY