spring-framework / org.springframework.web.accept / FixedContentNegotiationStrategy

FixedContentNegotiationStrategy

open class FixedContentNegotiationStrategy : ContentNegotiationStrategy

A ContentNegotiationStrategy that returns a fixed content type.

Author
Rossen Stoyanchev

Since
3.2

Constructors

<init>

FixedContentNegotiationStrategy(contentType: MediaType)

Constructor with a single default MediaType.

FixedContentNegotiationStrategy(contentTypes: 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(request: NativeWebRequest): MutableList<MediaType>