Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Net::HTTPHeader#delete
(::interned key) -> (::Array[::String] | nil)
delete(key)
lib/net/http/header.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/net/http/header.rb, line 471
def delete(key)
@header.delete(key.downcase.to_s)
end
Removes the header for the given case-insensitive key (see Fields); returns the deleted value, or nil if no such field exists:
Example
req = Net::HTTP::Get.new(uri) req.delete('Accept') # => ["*/*"] req.delete('Nosuch') # => nil
See also
#content_type=
#each
#content_type
#each_capitalized
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0