类 RestClientResponseException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.core.NestedRuntimeException
- org.springframework.web.client.RestClientException
- org.springframework.web.client.RestClientResponseException
- 所有已实现的接口:
Serializable
public class RestClientResponseException extends RestClientException
Common base class for exceptions that contain actual HTTP response data.- 从以下版本开始:
- 4.3
- 作者:
- Rossen Stoyanchev
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 RestClientResponseException(String message, int statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset)
Construct a new instance of with the given response data.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 int
getRawStatusCode()
Return the raw HTTP status code value.byte[]
getResponseBodyAsByteArray()
Return the response body as a byte array.String
getResponseBodyAsString()
Return the response body as a string.HttpHeaders
getResponseHeaders()
Return the HTTP response headers.String
getStatusText()
Return the HTTP status text.从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
构造器详细资料
RestClientResponseException
public RestClientResponseException(String message, int statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody, Charset responseCharset)
Construct a new instance of with the given response data.- 参数:
statusCode
- the raw status code valuestatusText
- the status textresponseHeaders
- the response headers (may benull
)responseBody
- the response body content (may benull
)responseCharset
- the response body charset (may benull
)
方法详细资料
getRawStatusCode
public int getRawStatusCode()
Return the raw HTTP status code value.
getStatusText
public String getStatusText()
Return the HTTP status text.
getResponseHeaders
public HttpHeaders getResponseHeaders()
Return the HTTP response headers.
getResponseBodyAsByteArray
public byte[] getResponseBodyAsByteArray()
Return the response body as a byte array.
getResponseBodyAsString
public String getResponseBodyAsString()
Return the response body as a string.