Top Description Constructors Methods
org.apache.http.impl.client

public abstract Class AbstractResponseHandler<T>

extends Object
implements ResponseHandler<T>
Class Inheritance
All Implemented Interfaces
org.apache.http.client.ResponseHandler
Known Direct Subclasses
org.apache.http.impl.client.BasicResponseHandler
Annotations
@Contract
threading:IMMUTABLE
Imports
java.io.IOException, org.apache.http.HttpEntity, .HttpResponse, .StatusLine, org.apache.http.annotation.Contract, .ThreadingBehavior, org.apache.http.client.HttpResponseException, .ResponseHandler, org.apache.http.util.EntityUtils

A generic ResponseHandler that works with the response entity for successful (2xx) responses. If the response code was >= 300, the response body is consumed and an HttpResponseException is thrown.

If this is used with org.apache.http.client.HttpClient#execute( org.apache.http.client.methods.HttpUriRequest, ResponseHandler), HttpClient may handle redirects (3xx responses) internally.

Since
4.4

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract T
handleEntity(HttpEntity entity)

Handle the response entity and transform it into the actual response object.

public T
handleResponse(final HttpResponse
The response to process
response
)

Implements org.apache.http.client.ResponseHandler.handleResponse.

Read the entity from the response body and pass it to the entity handler method if the response was successful (a 2xx status code).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractResponseHandlerback to summary
public AbstractResponseHandler()

Method Detail

handleEntityback to summary
public abstract T handleEntity(HttpEntity entity) throws IOException

Handle the response entity and transform it into the actual response object.

handleResponseback to summary
public T handleResponse(final HttpResponse response) throws HttpResponseException, IOException

Implements org.apache.http.client.ResponseHandler.handleResponse.

Read the entity from the response body and pass it to the entity handler method if the response was successful (a 2xx status code). If no response body exists, this returns null. If the response was unsuccessful (>= 300 status code), throws an HttpResponseException.

Parameters
response:HttpResponse

Doc from org.apache.http.client.ResponseHandler.handleResponse.

The response to process

Returns:T

Doc from org.apache.http.client.ResponseHandler.handleResponse.

A value determined by the response

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.http.client.ResponseHandler.handleResponse.

in case of a problem or the connection was aborted