Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Net::HTTPSession#delete

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

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

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

Example
http = Net::HTTP.new(hostname)
http.delete('/todos/1')
See also #debug #do_finish #D #do_start also in 4.1 · 4.0