End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Net::HTTPHeader#each_header
each_header() { |key| ... }
lib/net/http/header.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/net/http/header.rb, line 139
def each_header #:yield: +key+, +value+
block_given? or return enum_for(__method__) { @header.size }
@header.each do |k,va|
yield k, va.join(', ')
end
end
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}" }
See also
#each_capitalized_name
#each_key
#each_capitalized
#each_name
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1