Package org.springframework.web.accept

# Interface ContentNegotiationStrategy

All Known Implementing Classes:
  `AbstractMappingContentNegotiationStrategy`, `ContentNegotiationManager`, `FixedContentNegotiationStrategy`, `HeaderContentNegotiationStrategy`, `ParameterContentNegotiationStrategy`, `PathExtensionContentNegotiationStrategy`, `ServletPathExtensionContentNegotiationStrategy`

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ContentNegotiationStrategy
A strategy for resolving the requested media types for a request.

Since:
  3.2
Author:
  Rossen Stoyanchev

## Field Summary

Fields
Modifier and Type
Field
Description
`static final List<MediaType>`
`MEDIA_TYPE_ALL_LIST`
A singleton list with `MediaType.ALL` that is returned from `resolveMediaTypes(org.springframework.web.context.request.NativeWebRequest)` when no specific media types are requested.

## Method Summary

Modifier and Type
Method
Description
`List<MediaType>`
`resolveMediaTypes(NativeWebRequest webRequest)`
Resolve the given request to a list of media types.

## Field Details

### MEDIA_TYPE_ALL_LIST

static final List<MediaType> MEDIA_TYPE_ALL_LIST
A singleton list with `MediaType.ALL` that is returned from `resolveMediaTypes(org.springframework.web.context.request.NativeWebRequest)` when no specific media types are requested.

Since:
  5.0.5

## Method Details

### resolveMediaTypes

List<MediaType> resolveMediaTypes(NativeWebRequest webRequest) throws HttpMediaTypeNotAcceptableException
Resolve the given request to a list of media types. The returned list is ordered by specificity first and by quality parameter second.

Parameters:
  `webRequest` - the current request
Returns:
  the requested media types, or `MEDIA_TYPE_ALL_LIST` if none were requested.
Throws:
  `HttpMediaTypeNotAcceptableException` - if the requested media types cannot be parsed