クラス HttpMediaTypeNotSupportedException

java.lang.ObjectSE
java.lang.ThrowableSE
java.lang.ExceptionSE
jakarta.servlet.ServletException
org.springframework.web.HttpMediaTypeException
org.springframework.web.HttpMediaTypeNotSupportedException
実装されているすべてのインターフェース:
SerializableSE, ErrorResponse

public class HttpMediaTypeNotSupportedException extends HttpMediaTypeException
クライアントがリクエストハンドラーでサポートされていない型のコンテンツを POST、PUT、PATCH したときにスローされる例外。
導入:
3.0
作成者:
Arjen Poutsma, Rossen Stoyanchev
関連事項:
  • コンストラクターの詳細

    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(StringSE message)
      新しい HttpMediaTypeNotSupportedException を作成します。
      パラメーター:
      message - 例外メッセージ
    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(@Nullable StringSE message, ListSE<MediaType> mediaTypes)
      解析エラー用に新しい HttpMediaTypeNotSupportedException を作成します。
      パラメーター:
      message - 例外メッセージ
      mediaTypes - サポートされているメディア型のリスト
      導入:
      6.0.5
    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, ListSE<MediaType> mediaTypes)
      新しい HttpMediaTypeNotSupportedException を作成します。
      パラメーター:
      contentType - サポートされていないコンテンツ型
      mediaTypes - サポートされているメディア型のリスト
    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, ListSE<MediaType> mediaTypes, @Nullable HttpMethod httpMethod)
      新しい HttpMediaTypeNotSupportedException を作成します。
      パラメーター:
      contentType - サポートされていないコンテンツ型
      mediaTypes - サポートされているメディア型のリスト
      httpMethod - リクエストの HTTP メソッド
      導入:
      6.0
    • HttpMediaTypeNotSupportedException

      public HttpMediaTypeNotSupportedException(@Nullable MediaType contentType, ListSE<MediaType> supportedMediaTypes, @Nullable HttpMethod httpMethod, StringSE message)
      新しい HttpMediaTypeNotSupportedException を作成します。
      パラメーター:
      contentType - サポートされていないコンテンツ型
      supportedMediaTypes - サポートされているメディア型のリスト
      httpMethod - リクエストの HTTP メソッド
      message - 詳細メッセージ
      導入:
      6.0
  • メソッドの詳細

    • getContentType

      public @Nullable MediaType getContentType()
      失敗の原因となった HTTP リクエストコンテンツ型メソッドを返します。
    • getStatusCode

      public HttpStatusCode getStatusCode()
      インターフェースからコピーされた説明: ErrorResponse
      レスポンスに使用する HTTP ステータスコードを返します。
    • getHeaders

      public HttpHeaders getHeaders()
      インターフェースからコピーされた説明: ErrorResponse
      レスポンスに使用するヘッダーを返します。