Package software.amazon.awssdk.http
Interface SdkHttpHeaders
- All Known Subinterfaces:
SdkHttpFullRequest
,SdkHttpFullRequest.Builder
,SdkHttpFullResponse
,SdkHttpFullResponse.Builder
,SdkHttpRequest
,SdkHttpRequest.Builder
,SdkHttpResponse
,SdkHttpResponse.Builder
An immutable set of HTTP headers.
SdkHttpRequest
should be used for requests, and SdkHttpResponse
should be
used for responses.-
Method Summary
Modifier and TypeMethodDescriptionfirstMatchingHeader
(String header) Perform a case-insensitive search for a particular header in this request, returning the first matching header, if one is found.firstMatchingHeader
(Collection<String> headersToFind) default void
forEachHeader
(BiConsumer<? super String, ? super List<String>> consumer) headers()
Returns a map of all HTTP headers in this message, sorted in case-insensitive order by their header name.matchingHeaders
(String header) default int
-
Method Details
-
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
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.
-
firstMatchingHeader
-
matchingHeaders
-
forEachHeader
-
numHeaders
default int numHeaders()
-