Class: Net::HTTP

Inherits:
Object
  • Object
show all
Defined in:
lib/api-client/net/http.rb

Defined Under Namespace

Classes: Patch

Instance Method Summary collapse

Instance Method Details

#patch(path, data, initheader = nil, dest = nil, &block) ⇒ Object

Sends a PATCH request to the path and gets a response, as an HTTPResponse object.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/api-client/net/http.rb', line 5

def patch(path, data, initheader = nil, dest = nil, &block) # :yield: +body_segment+
  res = nil
  request(Patch.new(path, initheader), data) {|r|
    r.read_body dest, &block
    res = r
  }
  unless @newimpl
    res.value
    return res, res.body
  end
  res
end