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#each

each

Alias of #each_header

Iterates through the header names and values, passing in the name and value to the code block supplied.

Returns an enumerator if no block is given.

Example:

Example
response.header.each_header {|key,value| puts "#{key} = #{value}" }