Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Net::HTTPHeader#fetch

fetch(key, *args) { |key| ... }

Returns the header field corresponding to the case-insensitive key. Returns the default value args, or the result of the block, or raises an IndexError if there’s no header field named key See Hash#fetch

See also #each_value #form_data= #each_name #get_fields also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0