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_capitalized
each_capitalized() { |capitalize(k), join(', ')| ... }
lib/net/http/header.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/net/http/header.rb, line 211
def each_capitalized
block_given? or return enum_for(__method__) { @header.size }
@header.each do |k,v|
yield capitalize(k), v.join(', ')
end
end
As for each_header, except the keys are provided in capitalized form.
Note that header names are capitalized systematically; capitalization may not match that used by the remote HTTP server in its response.
Returns an enumerator if no block is given.
See also
#each
#each_capitalized_name
#delete
#each_header
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0