接口 RequestedContentTypeResolver
public interface RequestedContentTypeResolver
Strategy to resolve the requested media types for aServerWebExchange
.See
RequestedContentTypeResolverBuilder
to create a sequence of strategies.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
字段概要
字段 修饰符和类型 字段 说明 static List<MediaType>
MEDIA_TYPE_ALL_LIST
A singleton list withMediaType.ALL
that is returned fromresolveMediaTypes(org.springframework.web.server.ServerWebExchange)
when no specific media types are requested.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 List<MediaType>
resolveMediaTypes(ServerWebExchange exchange)
Resolve the given request to a list of requested media types.
字段详细资料
MEDIA_TYPE_ALL_LIST
static final List<MediaType> MEDIA_TYPE_ALL_LIST
A singleton list withMediaType.ALL
that is returned fromresolveMediaTypes(org.springframework.web.server.ServerWebExchange)
when no specific media types are requested.- 从以下版本开始:
- 5.0.5
方法详细资料
resolveMediaTypes
List<MediaType> resolveMediaTypes(ServerWebExchange exchange)
Resolve the given request to a list of requested media types. The returned list is ordered by specificity first and by quality parameter second.- 参数:
exchange
- the current exchange- 返回:
- the requested media types, or
MEDIA_TYPE_ALL_LIST
if none were requested. - 抛出:
NotAcceptableStatusException
- if the requested media type is invalid