Class HttpMediaTypeNotSupportedException

All Implemented Interfaces:
Serializable, ErrorResponse

public class HttpMediaTypeNotSupportedException extends HttpMediaTypeException
Exception thrown when a client POSTs, PUTs, or PATCHes content of a type not supported by request handler.
Since:
3.0
Author:
Arjen Poutsma, Rossen Stoyanchev
See Also:
  • Constructor Details

    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(String message)
      Create a new HttpMediaTypeNotSupportedException.
      Parameters:
      message - the exception message
    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(@Nullable String message, List<MediaType> mediaTypes)
      Create a new HttpMediaTypeNotSupportedException for a parse error.
      Parameters:
      message - the exception message
      mediaTypes - list of supported media types
      Since:
      6.0.5
    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, List<MediaType> mediaTypes)
      Create a new HttpMediaTypeNotSupportedException.
      Parameters:
      contentType - the unsupported content type
      mediaTypes - the list of supported media types
    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, List<MediaType> mediaTypes, @Nullable HttpMethod httpMethod)
      Create a new HttpMediaTypeNotSupportedException.
      Parameters:
      contentType - the unsupported content type
      mediaTypes - the list of supported media types
      httpMethod - the HTTP method of the request
      Since:
      6.0
    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, List<MediaType> supportedMediaTypes, @Nullable HttpMethod httpMethod, String message)
      Create a new HttpMediaTypeNotSupportedException.
      Parameters:
      contentType - the unsupported content type
      supportedMediaTypes - the list of supported media types
      httpMethod - the HTTP method of the request
      message - the detail message
      Since:
      6.0
  • Method Details

    • getContentType

      @Nullable public MediaType getContentType()
      Return the HTTP request content type method that caused the failure.
    • getStatusCode

      public HttpStatusCode getStatusCode()
      Description copied from interface: ErrorResponse
      Return the HTTP status code to use for the response.
    • getHeaders

      public HttpHeaders getHeaders()
      Description copied from interface: ErrorResponse
      Return headers to use for the response.