On this page
class Net::HTTP::Delete
Class for representing HTTP method DELETE:
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
Properties:
Request body: optional.
Response body: yes.
Safe: no.
Idempotent: yes.
Cacheable: no.
Related:
Net::HTTP#delete
: sendsDELETE
request, returns response object.
Constants
- METHOD
- REQUEST_HAS_BODY
- RESPONSE_HAS_BODY
Ruby Core © 1993–2022 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.