Method: Gem::Net::HTTP#request_put

Defined in:
lib/rubygems/vendor/net-http/lib/net/http.rb

#request_put(path, data, initheader = nil, &block) ⇒ Object Also known as: put2

Sends a PUT request to the server; returns an instance of a subclass of Gem::Net::HTTPResponse.

The request is based on the Gem::Net::HTTP::Put object created from string path, string data, and initial headers hash initheader.

http = Gem::Net::HTTP.new(hostname)
http.put('/todos/1', 'xyzzy')
# => #<Gem::Net::HTTPOK 200 OK readbody=true>


2308
2309
2310
# File 'lib/rubygems/vendor/net-http/lib/net/http.rb', line 2308

def request_put(path, data, initheader = nil, &block)   #:nodoc:
  request Put.new(path, initheader), data, &block
end