Interface RequestedContentTypeResolver

All Known Implementing Classes:
FixedContentTypeResolver, HeaderContentTypeResolver, ParameterContentTypeResolver

public interface RequestedContentTypeResolver
Strategy to resolve the requested media types for a ServerWebExchange.

See RequestedContentTypeResolverBuilder to create a sequence of strategies.

Since:
5.0
Author:
Rossen Stoyanchev
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<org.springframework.http.MediaType>
    A singleton list with MediaType.ALL that is returned from resolveMediaTypes(org.springframework.web.server.ServerWebExchange) when no specific media types are requested.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.springframework.http.MediaType>
    resolveMediaTypes(org.springframework.web.server.ServerWebExchange exchange)
    Resolve the given request to a list of requested media types.
  • Field Details

  • Method Details

    • resolveMediaTypes

      List<org.springframework.http.MediaType> resolveMediaTypes(org.springframework.web.server.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.
      Parameters:
      exchange - the current exchange
      Returns:
      the requested media types, or MEDIA_TYPE_ALL_LIST if none were requested.
      Throws:
      org.springframework.web.server.NotAcceptableStatusException - if the requested media type is invalid