目录

HttpResponseException

Class Info

public class HttpResponseException extends IOException

在HTTP响应中检测到错误状态代码时引发异常。

Public Constructor Summary

Constructor Name

HttpResponseException(HttpResponse response)

HttpResponseException类构造方法。

Public Method Summary

Qualifier and Type

Method Name and Description

StringBuffer

computeMessageBuffer(HttpResponse response)

创建存放给定HTTP响应的异常信息的StringBuilder 对象。

final String

getContent()

获取HTTP响应内容。

final ErrorResponse

getError()

获取错误响应。

HttpHeaders

getHeaders()

获取HTTP响应消息头。

final int

getStatusCode()

获取HTTP状态码。

final String

getStatusMessage()

获取HTTP状态信息。

final boolean

isSuccessStatusCode()

是否接收到一个成功的HTTP状态码。

Public Constructors

[h2]HttpResponseException

Constructor

public HttpResponseException(HttpResponse response)

HttpResponseException构造方法。

Parameters

Name

Description

response

HTTP响应。

Public Methods

[h2]computeMessageBuffer

Method

public static StringBuilder computeMessageBuffer(HttpResponse response)

创建存放给定HTTP响应的异常信息的StringBuilder 对象。

Parameters

Name

Description

response

HTTP响应。

Returns

Type

Description

StringBuilder

返回给定HTTP响应的异常信息。

[h2]getContent

Method

public final String getContent()

获取HTTP响应内容。

Returns

Type

Description

final String

返回HTTP响应的内容。

[h2]getError

Method

public final ErrorResponse getError()

获取错误响应。

Returns

Type

Description

ErrorResponse

返回一个错误响应对象。

[h2]getHeaders

Method

public HttpHeaders getHeaders()

获取HTTP响应消息头。

Returns

Type

Description

HttpHeaders

返回HTTP响应消息头。

[h2]getStatusCode

Method

public final int getStatusCode()

获取HTTP状态码。

Returns

Type

Description

final int

返回HTTP状态码。

[h2]getStatusMessage

Method

public final String getStatusMessage()

获取HTTP状态信息。

Returns

Type

Description

final String

返回HTTP状态信息。

[h2]isSuccessStatusCode

Method

public final boolean isSuccessStatusCode()

是否接收到一个成功的HTTP状态码。

Returns

Type

Description

final boolean

返回是否接收到一个成功的HTTP状态码。