public class WebClientResponseException extends WebClientException
| コンストラクターと説明 |
|---|
WebClientResponseException(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, CharsetSE charset) レスポンスデータのみを含むコンストラクター、およびデフォルトメッセージ。 |
WebClientResponseException(int status, StringSE reasonPhrase, HttpHeaders headers, byte[] body, CharsetSE charset, HttpRequest request) レスポンスデータのみを含むコンストラクター、およびデフォルトメッセージ。 |
WebClientResponseException(StringSE message, int statusCode, StringSE statusText, HttpHeaders headers, byte[] responseBody, CharsetSE charset) 準備されたメッセージを持つコンストラクター。 |
WebClientResponseException(StringSE message, int statusCode, StringSE statusText, HttpHeaders headers, byte[] responseBody, CharsetSE charset, HttpRequest request) 準備されたメッセージを持つコンストラクター。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
static WebClientResponseException | create(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, CharsetSE charset)WebClientResponseException または HTTP ステータス固有のサブクラスを作成します。 |
static WebClientResponseException | create(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, CharsetSE charset, HttpRequest request)WebClientResponseException または HTTP ステータス固有のサブクラスを作成します。 |
HttpHeaders | getHeaders()HTTP レスポンスヘッダーを返します。 |
int | getRawStatusCode() 生の HTTP ステータスコード値を返します。 |
HttpRequest | getRequest() 対応するリクエストを返します。 |
byte[] | getResponseBodyAsByteArray() レスポンス本文をバイト配列として返します。 |
StringSE | getResponseBodyAsString() 可能な場合は、レスポンスのメディア型の文字セットを使用して、レスポンスの内容を文字列として返します。そうでない場合は、ISO-8859-1 にフォールバックします。 |
StringSE | getResponseBodyAsString(CharsetSE defaultCharset) レスポンスのメディア型から文字セットが利用できない場合に、フォールバックする文字セットを指定できるようにする getResponseBodyAsString() のバリアント。 |
HttpStatus | getStatusCode()HTTP ステータスコード値を返します。 |
StringSE | getStatusText()HTTP ステータステキストを返します。 |
contains, getMessage, getMostSpecificCause, getRootCauseaddSuppressedSE, fillInStackTraceSE, getCauseSE, getLocalizedMessageSE, getStackTraceSE, getSuppressedSE, initCauseSE, printStackTraceSE, printStackTraceSE, printStackTraceSE, setStackTraceSE, toStringSEcloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSEpublic WebClientResponseException(int statusCode,
StringSE statusText,
@Nullable
HttpHeaders headers,
@Nullable
byte[] body,
@Nullable
CharsetSE charset)public WebClientResponseException(int status,
StringSE reasonPhrase,
@Nullable
HttpHeaders headers,
@Nullable
byte[] body,
@Nullable
CharsetSE charset,
@Nullable
HttpRequest request)public WebClientResponseException(StringSE message, int statusCode, StringSE statusText, @Nullable HttpHeaders headers, @Nullable byte[] responseBody, @Nullable CharsetSE charset)
public WebClientResponseException(StringSE message, int statusCode, StringSE statusText, @Nullable HttpHeaders headers, @Nullable byte[] responseBody, @Nullable CharsetSE charset, @Nullable HttpRequest request)
public HttpStatus getStatusCode()
IllegalArgumentExceptionSE - 不明な HTTP ステータスコードの場合 public int getRawStatusCode()
public StringSE getStatusText()
public HttpHeaders getHeaders()
public byte[] getResponseBodyAsByteArray()
public StringSE getResponseBodyAsString()
getResponseBodyAsString(Charset) を使用します。public StringSE getResponseBodyAsString(CharsetSE defaultCharset)
getResponseBodyAsString() のバリアント。defaultCharset - レスポンスの Content-Type で指定されていない場合に使用する文字セット。@Nullable public HttpRequest getRequest()
public static WebClientResponseException create(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, @Nullable CharsetSE charset)
WebClientResponseException または HTTP ステータス固有のサブクラスを作成します。public static WebClientResponseException create(int statusCode, StringSE statusText, HttpHeaders headers, byte[] body, @Nullable CharsetSE charset, @Nullable HttpRequest request)
WebClientResponseException または HTTP ステータス固有のサブクラスを作成します。