Interface SdkHttpHeaders

    • Method Detail

      • headers

        Map<String,​List<String>> headers()
        Returns a map of all HTTP headers in this message, sorted in case-insensitive order by their header name.

        This will never be null. If there are no headers an empty map is returned.

        Returns:
        An unmodifiable map of all headers in this message.
      • firstMatchingHeader

        default Optional<String> firstMatchingHeader​(String header)
        Perform a case-insensitive search for a particular header in this request, returning the first matching header, if one is found.

        This is useful for headers like 'Content-Type' or 'Content-Length' of which there is expected to be only one value present.

        This is equivalent to invoking SdkHttpUtils.firstMatchingHeader(Map, String)

        .
        Parameters:
        header - The header to search for (case insensitively).
        Returns:
        The first header that matched the requested one, or empty if one was not found.
      • anyMatchingHeader

        default boolean anyMatchingHeader​(Predicate<String> predicate)
        Returns whether any header key matches the provided predicate.
        Parameters:
        predicate - the predicate to apply to all header keys
        Returns:
        true if any header key matches the provided predicate, otherwise false
      • numHeaders

        default int numHeaders()