public class HeaderContentNegotiationStrategy extends java.lang.Object implements ContentNegotiationStrategy
ContentNegotiationStrategy
that checks the 'Accept' request header.MEDIA_TYPE_ALL_LIST
Constructor and Description |
---|
HeaderContentNegotiationStrategy() |
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
resolveMediaTypes(NativeWebRequest request)
Resolve the given request to a list of media types.
|
public java.util.List<MediaType> resolveMediaTypes(NativeWebRequest request) throws HttpMediaTypeNotAcceptableException
resolveMediaTypes
in interface ContentNegotiationStrategy
request
- the current requestContentNegotiationStrategy.MEDIA_TYPE_ALL_LIST
if none
were requested.HttpMediaTypeNotAcceptableException
- if the 'Accept' header cannot be parsed