spring-framework / org.springframework.web.reactive.accept / FixedContentTypeResolver

FixedContentTypeResolver

open class FixedContentTypeResolver : RequestedContentTypeResolver

Resolver that always resolves to a fixed list of media types. This can be used as the "last in line" strategy providing a fallback for when the client has not requested any media types.

Author
Rossen Stoyanchev

Since
5.0

Constructors

<init>

FixedContentTypeResolver(mediaType: MediaType)

Constructor with a single default MediaType.

FixedContentTypeResolver(mediaTypes: MutableList<MediaType>)

Constructor with an ordered List of default MediaType's to return for use in applications that support a variety of content types.

Consider appending MediaType#ALL at the end if destinations are present which do not support any of the other default media types.

Functions

getContentTypes

open fun getContentTypes(): MutableList<MediaType>

Return the configured list of media types.

resolveMediaTypes

open fun resolveMediaTypes(exchange: ServerWebExchange): MutableList<MediaType>