程序包 cn.taketoday.web

类 UnsupportedMediaTypeStatusException

所有已实现的接口:
HttpStatusCodeProvider, ErrorResponse, Serializable

public class UnsupportedMediaTypeStatusException extends ResponseStatusException
Exception for errors that fit response status 415 (unsupported media type).
从以下版本开始:
4.0 2022/3/2 15:59
作者:
Rossen Stoyanchev, Harry Yang
另请参阅:
  • 字段详细资料

    • contentType

      @Nullable private final MediaType contentType
    • supportedMediaTypes

      private final List<MediaType> supportedMediaTypes
    • bodyType

      @Nullable private final cn.taketoday.core.ResolvableType bodyType
    • method

      @Nullable private final HttpMethod method
  • 构造器详细资料

    • UnsupportedMediaTypeStatusException

      public UnsupportedMediaTypeStatusException(@Nullable String reason)
      Constructor for when the specified Content-Type is invalid.
    • UnsupportedMediaTypeStatusException

      public UnsupportedMediaTypeStatusException(@Nullable String reason, List<MediaType> supportedTypes)
      Constructor for when the specified Content-Type is invalid.
    • UnsupportedMediaTypeStatusException

      public UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes)
      Constructor for when the Content-Type can be parsed but is not supported.
    • UnsupportedMediaTypeStatusException

      public UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable cn.taketoday.core.ResolvableType bodyType)
      Constructor for when trying to encode from or decode to a specific Java type.
    • UnsupportedMediaTypeStatusException

      public UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable HttpMethod method)
      Constructor that provides the HTTP method.
    • UnsupportedMediaTypeStatusException

      public UnsupportedMediaTypeStatusException(@Nullable MediaType contentType, List<MediaType> supportedTypes, @Nullable cn.taketoday.core.ResolvableType bodyType, @Nullable HttpMethod method)
      Constructor for when trying to encode from or decode to a specific Java type.
  • 方法详细资料

    • getContentType

      @Nullable public MediaType getContentType()
      Return the request Content-Type header if it was parsed successfully, or null otherwise.
    • getSupportedMediaTypes

      public List<MediaType> getSupportedMediaTypes()
      Return the list of supported content types in cases when the Content-Type header is parsed but not supported, or an empty list otherwise.
    • getBodyType

      @Nullable public cn.taketoday.core.ResolvableType getBodyType()
      Return the body type in the context of which this exception was generated.

      This is applicable when the exception was raised as a result trying to encode from or decode to a specific Java type.

      返回:
      the body type, or null if not available
    • getHeaders

      public HttpHeaders getHeaders()
      Return HttpHeaders with an "Accept" header that documents the supported media types, if available, or an empty instance otherwise.
      指定者:
      getHeaders 在接口中 ErrorResponse
      覆盖:
      getHeaders 在类中 ResponseStatusException