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
lib/net/http/header.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/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
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}" }
See also
#each_header
#delete
#each_capitalized
#content_type=
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0