Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class · Ruby 4.1

Net::HTTP::Delete

Class for representing HTTP method DELETE:

Example
require 'net/http'
uri = URI('http://example.com')
hostname = uri.hostname # => "example.com"
uri.path = '/posts/1'
req = Net::HTTP::Delete.new(uri) # => #<Net::HTTP::Delete DELETE>
res = Net::HTTP.start(hostname) do |http|
  http.request(req)
end

See Request Headers.

Properties:

Related: