We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All

HttpResponseException

Expand

Class Info

public class HttpResponseException extends IOException

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

Public Constructor Summary

Expand

Constructor Name

HttpResponseException(HttpResponse response)

Constructs an HttpResponseException object.

Public Method Summary

Expand

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

HttpResponseException

Expand

Constructor

public HttpResponseException(HttpResponse response)

Constructs an HttpResponseException object.

Parameters

Expand

Name

Description

response

HTTP response.

Public Methods

computeMessageBuffer

Expand

Method

public static StringBuilder computeMessageBuffer(HttpResponse response)

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

Parameters

Expand

Name

Description

response

HTTP response.

Returns

Expand

Type

Description

StringBuilder

Error information of the given HTTP response.

getContent

Expand

Method

public final String getContent()

Obtains the HTTP response content.

Returns

Expand

Type

Description

final String

HTTP response content.

getError

Expand

Method

public final ErrorResponse getError()

Obtains the error response.

Returns

Expand

Type

Description

ErrorResponse

Error response object.

getHeaders

Expand

Method

public HttpHeaders getHeaders()

Obtains headers in the HTTP response.

Returns

Expand

Type

Description

HttpHeaders

Headers in the HTTP response.

getStatusCode

Expand

Method

public final int getStatusCode()

Obtains the HTTP status code.

Returns

Expand

Type

Description

final int

HTTP status code.

getStatusMessage

Expand

Method

public final String getStatusMessage()

Obtains the HTTP status information.

Returns

Expand

Type

Description

final String

HTTP status information.

isSuccessStatusCode

Expand

Method

public final boolean isSuccessStatusCode()

Checks whether a success HTTP status code is received.

Returns

Expand

Type

Description

final boolean

Whether a success HTTP status code is received.

Search
Enter a keyword.