HTTP2::Headers
Inherits Enumerable < Reference < Object
An ordered, duplicate-preserving collection of HTTP fields.
Constructors
HTTP::Headers field names are case-insensitive (RFC 9110 §5.1) but
HTTP/2 requires lowercase on the wire (RFC 9113 §8.2.1); downcasing
here is lossless and lets stdlib-interop callers pass mixed-case names
without tripping outbound validation. Values are untouched.
Instance methods
Returns the first field value with exactly matching lowercase name.
Appends a field without replacing existing fields of the same name.
Returns a shallow copy of this object.
This allocates a new object and copies the contents of
self into it.
Returns true if self does not contain any element.
([] of Int32).empty? # => true
([1]).empty? # => false
[nil, false].empty? # => false
#present?returns the inverse.
Returns every value with exactly matching lowercase name, in wire order.
Returns an Array with all the elements in the collection.
(1..5).to_a # => [1, 2, 3, 4, 5]