Method: Gem::Net::HTTPHeader#delete

Defined in:
lib/rubygems/net-http/lib/net/http/header.rb

#delete(key) ⇒ Object

Removes the header for the given case-insensitive key (see Fields); returns the deleted value, or nil if no such field exists:

req = Gem::Net::HTTP::Get.new(uri)
req.delete('Accept') # => ["*/*"]
req.delete('Nosuch') # => nil


453
454
455
# File 'lib/rubygems/net-http/lib/net/http/header.rb', line 453

def delete(key)
  @header.delete(key.downcase.to_s)
end