目录

HttpResponseException

Class Info

public class HttpResponseException extends IOException

Exception thrown when an error status code is detected in the HTTP response.

Public Constructor Summary

Constructor Name

HttpResponseException(HttpResponse response)

Constructs an HttpResponseException object.

Public Method Summary

Qualifier and Type

Method Name and Description

StringBuffer

computeMessageBuffer(HttpResponse response)

Creates a StringBuilder object containing the error information of the given HTTP response.

final String

getContent()

Obtains the HTTP response content.

final ErrorResponse

getError()

Obtains the error response.

HttpHeaders

getHeaders()

Obtains headers in the HTTP response.

final int

getStatusCode()

Obtains the HTTP status code.

final String

getStatusMessage()

Obtains the HTTP status information.

final boolean

isSuccessStatusCode()

Checks whether a success HTTP status code is received.

Public Constructors

[h2]HttpResponseException

Constructor

public HttpResponseException(HttpResponse response)

Constructs an HttpResponseException object.

Parameters

Name

Description

response

HTTP response.

Public Methods

[h2]computeMessageBuffer

Method

public static StringBuilder computeMessageBuffer(HttpResponse response)

Creates a StringBuilder object containing the error information of the given HTTP response.

Parameters

Name

Description

response

HTTP response.

Returns

Type

Description

StringBuilder

Error information of the given HTTP response.

[h2]getContent

Method

public final String getContent()

Obtains the HTTP response content.

Returns

Type

Description

final String

HTTP response content.

[h2]getError

Method

public final ErrorResponse getError()

Obtains the error response.

Returns

Type

Description

ErrorResponse

Error response object.

[h2]getHeaders

Method

public HttpHeaders getHeaders()

Obtains headers in the HTTP response.

Returns

Type

Description

HttpHeaders

Headers in the HTTP response.

[h2]getStatusCode

Method

public final int getStatusCode()

Obtains the HTTP status code.

Returns

Type

Description

final int

HTTP status code.

[h2]getStatusMessage

Method

public final String getStatusMessage()

Obtains the HTTP status information.

Returns

Type

Description

final String

HTTP status information.

[h2]isSuccessStatusCode

Method

public final boolean isSuccessStatusCode()

Checks whether a success HTTP status code is received.

Returns

Type

Description

final boolean

Whether a success HTTP status code is received.