Interface ClientResponseHeaders
- All Known Subinterfaces:
ServerResponseHeaders
HTTP Headers of a client response.
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<HttpMediaType> Accepted patches.default List<HttpMediaType> Media types supported by the resource forMethod.QUERYrequest content.static ClientResponseHeadersCreate a new instance from headers parsed from client response.static ClientResponseHeaderscreate(Headers responseHeaders, ParserMode parserMode) Create a new instance from headers parsed from client response.default Optional<ZonedDateTime> expires()Optionally gets the value ofHeaderNames.EXPIRESheader.default Optional<ZonedDateTime> Optionally gets the value ofHeaderNames.LAST_MODIFIEDheader.location()Optionally gets the value ofHeaderNames.LOCATIONheader.Methods inherited from interface Headers
acceptedTypes, all, contains, contains, containsToken, contentLength, contentType, find, first, get, isAccepted, size, stream, toMap, value, valuesModifier and TypeMethodDescriptionReturns a list of acceptedTypes (HeaderNames.ACCEPTheader) content discoveryTypes in quality factor order.all(HeaderName name, Supplier<List<String>> defaultSupplier) Get all values of a header.booleanWhether these headers contain a header with the provided name and value.booleancontains(HeaderName name) Whether these headers contain a header with the provided name.default booleancontainsToken(Header value) Whether these headers contain all tokenized values from the provided header.default OptionalLongContent length if defined.default Optional<HttpMediaType> Content type (if defined).find(HeaderName headerName) Find the first header.first(HeaderName headerName) Returns a first header value.get(HeaderName name) Get a header value.default booleanisAccepted(MediaType... mediaTypes) Whether this media type is accepted by these headers.intsize()Number of headers in these headers.stream()A sequential stream with these headers as the source.toMap()Deprecated.use other methods to handle headers, preferably using pull approachvalue(HeaderName headerName) Returns a header value as a singleStringpotentially concatenated using comma character fromHeaders.all(HeaderName, java.util.function.Supplier)header fields.values(HeaderName headerName) Returns an unmodifiableListof all comma separated header value parts - Such segmentation is NOT valid for all header semantics, however it is very common.Methods inherited from interface Iterable
forEach, iterator, spliterator
-
Method Details
-
create
Create a new instance from headers parsed from client response. Strict media type parsing mode is used forContent-Typeheader.- Parameters:
responseHeaders- client response headers- Returns:
- immutable instance of client response HTTP headers
-
create
Create a new instance from headers parsed from client response.- Parameters:
responseHeaders- client response headersparserMode- media type parsing mode- Returns:
- immutable instance of client response HTTP headers
-
acceptPatches
Accepted patches.- Returns:
- list of accepted patches media types
-
acceptQueries
Media types supported by the resource forMethod.QUERYrequest content.- Returns:
- list of accepted QUERY media types, or an empty list if the header is absent or invalid
-
location
Optionally gets the value ofHeaderNames.LOCATIONheader.Used in redirection, or when a new resource has been created.
- Returns:
- Location header value.
-
lastModified
Optionally gets the value ofHeaderNames.LAST_MODIFIEDheader.The last modified date for the requested object.
- Returns:
- Last modified header value.
-
expires
Optionally gets the value ofHeaderNames.EXPIRESheader.Gives the date/time after which the response is considered stale.
- Returns:
- Expires header value.
-