Interface HTTPHeaders


@Immutable public interface HTTPHeaders
Represents a group of HTTP headers.

Header name comparison in this class is always case-insensitive, in accordance with RFC 2616.

This class exposes methods to convert to and from different representations such as maps and multimap, for easier access and manipulation – especially when dealing with multiple headers with the same name.

  • Field Details

  • Method Details

    • entries

      Returns all the header entries in this group.
    • entries

      default Set<HTTPHeaders.HTTPHeader> entries(String name)
      Returns all the entries in this group for the given name (case-insensitive).
    • contains

      default boolean contains(String name)
      Returns whether this group contains an entry with the given name (case-insensitive).
    • putIfAbsent

      default HTTPHeaders putIfAbsent(HTTPHeaders.HTTPHeader header)
      Adds the given header to the current group if no entry with the same name is already present. Returns a new instance with the added header, or the current instance if the header is already present.
    • putIfAbsent

      default HTTPHeaders putIfAbsent(HTTPHeaders headers)
      Adds the given headers to the current group if no entries with same names are already present. Returns a new instance with the added headers, or the current instance if all headers are already present.
    • of

      static HTTPHeaders of(HTTPHeaders.HTTPHeader... headers)
    • of

      static HTTPHeaders of(Map<String,String> headers)