End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Net::HTTPHeader#key?
key?(key)
lib/net/http/header.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/net/http/header.rb, line 455
def key?(key)
@header.key?(key.downcase.to_s)
end
Returns true if the field for the case-insensitive key exists, false otherwise:
Example
req = Net::HTTP::Get.new(uri) req.key?('Accept') # => true req.key?('Nosuch') # => false
See also
#get_fields
#main_type
#form_data=
#proxy_basic_auth
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0