Class HeaderContentTypeResolver
- java.lang.Object
- org.springframework.web.reactive.accept.HeaderContentTypeResolver
- All Implemented Interfaces:
RequestedContentTypeResolver
public class HeaderContentTypeResolver extends Object implements RequestedContentTypeResolver
Resolver that looks at the 'Accept' header of the request.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
Field Summary
Fields inherited from interface org.springframework.web.reactive.accept.RequestedContentTypeResolver
MEDIA_TYPE_ALL_LIST
Constructor Summary
Constructors Constructor Description HeaderContentTypeResolver()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<MediaType>
resolveMediaTypes(ServerWebExchange exchange)
Resolve the given request to a list of requested media types.
Constructor Detail
HeaderContentTypeResolver
public HeaderContentTypeResolver()
Method Detail
resolveMediaTypes
public List<MediaType> resolveMediaTypes(ServerWebExchange exchange) throws NotAcceptableStatusException
Description copied from interface:RequestedContentTypeResolver
Resolve the given request to a list of requested media types. The returned list is ordered by specificity first and by quality parameter second.- Specified by:
resolveMediaTypes
in interfaceRequestedContentTypeResolver
- Parameters:
exchange
- the current exchange- Returns:
- the requested media types, or
RequestedContentTypeResolver.MEDIA_TYPE_ALL_LIST
if none were requested. - Throws:
NotAcceptableStatusException
- if the requested media type is invalid