Class UnsupportedMediaException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.micronaut.http.exceptions.HttpException
io.micronaut.http.exceptions.HttpStatusException
io.micronaut.http.server.exceptions.UnsupportedMediaException
All Implemented Interfaces:
Serializable

public final class UnsupportedMediaException extends io.micronaut.http.exceptions.HttpStatusException
Exception thrown when the requested Content-Type is not supported.
Since:
4.6.0
See Also:
  • Constructor Details

    • UnsupportedMediaException

      public UnsupportedMediaException(String contentType, Collection<String> acceptableContentTypes)
      Parameters:
      contentType - Requested Content Type
      acceptableContentTypes - Acceptable content types
  • Method Details

    • getContentType

      public String getContentType()
      Returns:
      Requested Content Type
    • getAcceptableContentTypes

      public Collection<String> getAcceptableContentTypes()
      Returns:
      Acceptable content types