程序包 cn.taketoday.web
类 UnsupportedMediaTypeStatusException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cn.taketoday.core.NestedRuntimeException
cn.taketoday.web.ErrorResponseException
cn.taketoday.web.ResponseStatusException
cn.taketoday.web.UnsupportedMediaTypeStatusException
- 所有已实现的接口:
HttpStatusCodeProvider,ErrorResponse,Serializable
Exception for errors that fit response status 415 (unsupported media type).
- 从以下版本开始:
- 4.0 2022/3/2 15:59
- 作者:
- Rossen Stoyanchev, Harry Yang
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private final cn.taketoday.core.ResolvableTypeprivate final MediaTypeprivate final HttpMethod -
构造器概要
构造器构造器说明UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes) Constructor for when the Content-Type can be parsed but is not supported.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, cn.taketoday.core.ResolvableType bodyType) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, cn.taketoday.core.ResolvableType bodyType, HttpMethod method) Constructor for when trying to encode from or decode to a specific Java type.UnsupportedMediaTypeStatusException(MediaType contentType, List<MediaType> supportedTypes, HttpMethod method) Constructor that provides the HTTP method.Constructor for when the specified Content-Type is invalid.UnsupportedMediaTypeStatusException(String reason, List<MediaType> supportedTypes) Constructor for when the specified Content-Type is invalid. -
方法概要
修饰符和类型方法说明cn.taketoday.core.ResolvableTypeReturn the body type in the context of which this exception was generated.Return the request Content-Type header if it was parsed successfully, ornullotherwise.Return HttpHeaders with an "Accept" header that documents the supported media types, if available, or an empty instance otherwise.Return the list of supported content types in cases when the Content-Type header is parsed but not supported, or an empty list otherwise.从类继承的方法 cn.taketoday.web.ResponseStatusException
getMessage, getReason从类继承的方法 cn.taketoday.web.ErrorResponseException
getBody, getStatusCode, setDetail, setInstance, setTitle, setType从类继承的方法 cn.taketoday.core.NestedRuntimeException
contains, getMostSpecificCause, getNestedMessage, getRootCause
-
字段详细资料
-
contentType
-
supportedMediaTypes
-
bodyType
@Nullable private final cn.taketoday.core.ResolvableType bodyType -
method
-
-
构造器详细资料
-
UnsupportedMediaTypeStatusException
Constructor for when the specified Content-Type is invalid. -
UnsupportedMediaTypeStatusException
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
Return the request Content-Type header if it was parsed successfully, ornullotherwise. -
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
nullif not available
-
getHeaders
Return HttpHeaders with an "Accept" header that documents the supported media types, if available, or an empty instance otherwise.- 指定者:
getHeaders在接口中ErrorResponse- 覆盖:
getHeaders在类中ResponseStatusException
-