org.springframework.web

Class HttpMediaTypeNotSupportedException

  • All Implemented Interfaces:
    java.io.Serializable


    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
    See Also:
    Serialized Form
    • Constructor Detail

      • HttpMediaTypeNotSupportedException

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

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

        public HttpMediaTypeNotSupportedException(@Nullable
                                                  MediaType contentType,
                                                  java.util.List<MediaType> supportedMediaTypes,
                                                  java.lang.String msg)
        Create a new HttpMediaTypeNotSupportedException.
        Parameters:
        contentType - the unsupported content type
        supportedMediaTypes - the list of supported media types
        msg - the detail message
    • Method Detail

      • getContentType

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