Method: Gem::Net::HTTP#delete

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

#delete(path, initheader = {'Depth' => 'Infinity'}) ⇒ Object

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

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

http = Gem::Net::HTTP.new(hostname)
http.delete('/todos/1')


2175
2176
2177
# File 'lib/rubygems/vendor/net-http/lib/net/http.rb', line 2175

def delete(path, initheader = {'Depth' => 'Infinity'})
  request(Delete.new(path, initheader))
end