Class: Net::HTTP

Inherits:
Object
  • Object
show all
Defined in:
lib/crapi/client.rb

Overview

Net::HTTP needs a shortcut instance method for PUT calls like it does for GET/DELETE/PATCH/POST.

Instance Method Summary collapse

Instance Method Details

#put(path, data, initheader = nil, dest = nil, &block) ⇒ Net::HTTPResponse

Convenience PUT method monkey-patched into Net::HTTP.

Net::HTTP provides handy methods for DELETE, GET, HEAD, OPTIONS, PATCH, and POST, but not PUT, so we have to monkey-patch one in. The parameters listed below were chosen to match those in use for the other Net::HTTP request methods in both name and meaning.

Parameters:

  • path (String)
  • data (String)
  • initheader (Hash) (defaults to: nil)
  • dest (nil) (defaults to: nil)

Returns:

  • (Net::HTTPResponse)

See Also:



353
354
355
# File 'lib/crapi/client.rb', line 353

def put(path, data, initheader = nil, dest = nil, &block)
  send_entity(path, data, initheader, dest, Put, &block)
end