public class UnsupportedMediaTypeException
extends org.springframework.core.NestedRuntimeException
Content-Type is not supported.| Constructor and Description |
|---|
UnsupportedMediaTypeException(org.springframework.http.MediaType contentType,
java.util.List<org.springframework.http.MediaType> supportedMediaTypes)
Constructor for when the Content-Type can be parsed but is not supported.
|
UnsupportedMediaTypeException(java.lang.String reason)
Constructor for when the specified Content-Type is invalid.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.MediaType |
getContentType()
Return the request Content-Type header if it was parsed successfully,
or
null otherwise. |
java.util.List<org.springframework.http.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.
|
contains, getMessage, getMostSpecificCause, getRootCausepublic UnsupportedMediaTypeException(java.lang.String reason)
public UnsupportedMediaTypeException(@Nullable
org.springframework.http.MediaType contentType,
java.util.List<org.springframework.http.MediaType> supportedMediaTypes)
@Nullable public org.springframework.http.MediaType getContentType()
null otherwise.public java.util.List<org.springframework.http.MediaType> getSupportedMediaTypes()