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_capitalized

each_capitalized() { |capitalize(k), join(', ')| ... }

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