Maintenance Ruby 3.4 gets fixes, but no new features. 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-3.4.1/lib/net/http/header.rb, line 453
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.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0