クラス RestClientResponseException
java.lang.ObjectSE
java.lang.ThrowableSE
java.lang.ExceptionSE
java.lang.RuntimeExceptionSE
org.springframework.core.NestedRuntimeException
org.springframework.web.client.RestClientException
org.springframework.web.client.RestClientResponseException
- 実装されているすべてのインターフェース:
SerializableSE
実際の HTTP レスポンスデータを含む例外の共通基本クラス。
- 導入:
- 4.3
- 作成者:
- Rossen Stoyanchev
- 関連事項:
コンストラクターの概要
コンストラクターコンストラクター説明RestClientResponseException(StringSE message, int statusCode, StringSE statusText, @Nullable HttpHeaders headers, byte @Nullable [] responseBody, @Nullable CharsetSE responseCharset) 指定されたレスポンスデータでの新しいインスタンスを構築します。RestClientResponseException(StringSE message, HttpStatusCode statusCode, StringSE statusText, @Nullable HttpHeaders headers, byte @Nullable [] responseBody, @Nullable CharsetSE responseCharset) 指定されたレスポンスデータでの新しいインスタンスを構築します。方法の概要
修飾子と型メソッド説明<E> @Nullable EgetResponseBodyAs(ClassSE<E> targetType) エラーレスポンスの内容を指定された型に変換します。<E> @Nullable EgetResponseBodyAs(ParameterizedTypeReference<E> targetType) byte[]レスポンス本文をバイト配列として返します。レスポンス本文を文字列に変換して返します。getResponseBodyAsString(CharsetSE fallbackCharset) レスポンス本文を文字列に変換して返します。HTTP レスポンスヘッダーを返します。HTTP ステータスコードを返します。HTTP ステータステキストを返します。voidsetBodyConvertFunction(FunctionSE<ResolvableType, ? extends @Nullable ObjectSE> bodyConvertFunction) getResponseBodyAs(Class)を介してレスポンスエラーの内容をデコードするために使用する関数を提供します。クラス NestedRuntimeException から継承されたメソッド
contains, getMostSpecificCause, getRootCause
コンストラクターの詳細
RestClientResponseException
public RestClientResponseException(StringSE message, int statusCode, StringSE statusText, @Nullable HttpHeaders headers, byte @Nullable [] responseBody, @Nullable CharsetSE responseCharset) 指定されたレスポンスデータでの新しいインスタンスを構築します。- パラメーター:
statusCode- 生のステータスコード値statusText- ステータステキストheaders- レスポンスヘッダー (nullの場合があります)responseBody- レスポンス本文のコンテンツ (nullの場合があります)responseCharset- レスポンス本体の文字セット (nullの場合があります)
RestClientResponseException
public RestClientResponseException(StringSE message, HttpStatusCode statusCode, StringSE statusText, @Nullable HttpHeaders headers, byte @Nullable [] responseBody, @Nullable CharsetSE responseCharset) 指定されたレスポンスデータでの新しいインスタンスを構築します。- パラメーター:
statusCode- 生のステータスコード値statusText- ステータステキストheaders- レスポンスヘッダー (nullの場合があります)responseBody- レスポンス本文のコンテンツ (nullの場合があります)responseCharset- レスポンス本体の文字セット (nullの場合があります)- 導入:
- 6.0
メソッドの詳細
getStatusCode
getStatusText
HTTP ステータステキストを返します。getResponseHeaders
HTTP レスポンスヘッダーを返します。getResponseBodyAsByteArray
public byte[] getResponseBodyAsByteArray()レスポンス本文をバイト配列として返します。getResponseBodyAsString
レスポンス本文を文字列に変換して返します。使用される文字セットは、レスポンス "Content-Type" またはその他の"UTF-8"の文字セットです。getResponseBodyAsString
getResponseBodyAs
getResponseBodyAs
- 導入:
- 6.0
setBodyConvertFunction
public void setBodyConvertFunction(FunctionSE<ResolvableType, ? extends @Nullable ObjectSE> bodyConvertFunction) getResponseBodyAs(Class)を介してレスポンスエラーの内容をデコードするために使用する関数を提供します。- パラメーター:
bodyConvertFunction- 使用する関数- 導入:
- 6.0