public class UnsupportedMediaTypeStatusException extends ResponseStatusException
| Constructor and Description |
|---|
UnsupportedMediaTypeStatusException(MediaType contentType,
List<MediaType> supportedMediaTypes)
Constructor for when the Content-Type can be parsed but is not supported.
|
UnsupportedMediaTypeStatusException(String reason)
Constructor for when the specified Content-Type is invalid.
|
| Modifier and Type | Method and Description |
|---|---|
MediaType |
getContentType()
Return the request Content-Type header if it was parsed successfully,
or
null otherwise. |
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.
|
getMessage, getReason, getStatuscontains, getMostSpecificCause, getRootCauseaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic UnsupportedMediaTypeStatusException(@Nullable String reason)