@Immutable public interface SdkHttpHeaders
SdkHttpRequest
should be used for requests, and SdkHttpResponse
should be
used for responses.Modifier and Type | Method and Description |
---|---|
default Optional<String> |
firstMatchingHeader(Collection<String> headersToFind) |
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.
|
default void |
forEachHeader(BiConsumer<? super String,? super List<String>> consumer) |
Map<String,List<String>> |
headers()
Returns a map of all HTTP headers in this message, sorted in case-insensitive order by their header name.
|
default List<String> |
matchingHeaders(String header) |
default int |
numHeaders() |
Map<String,List<String>> headers()
This will never be null. If there are no headers an empty map is returned.
default Optional<String> firstMatchingHeader(String header)
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)
header
- The header to search for (case insensitively).default Optional<String> firstMatchingHeader(Collection<String> headersToFind)
default void forEachHeader(BiConsumer<? super String,? super List<String>> consumer)
default int numHeaders()
Copyright © 2022. All rights reserved.