Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

BasicResponseHandler

extends Object
implements ResponseHandler <T>
java.lang.Object
   ↳ org.apache.http.impl.client.BasicResponseHandler

Class Overview

A ResponseHandler that returns the response body as a String 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 {@link org.apache.http.client.HttpClient#execute( org.apache.http.client.methods.HttpUriRequest, ResponseHandler), HttpClient may handle redirects (3xx responses) internally.

Summary

Public Constructors
BasicResponseHandler ()
Public Methods
String handleResponse ( HttpResponse response)
Returns the response body as a String if the response was successful (a 2xx status code).
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.http.client.ResponseHandler

Public Constructors

public BasicResponseHandler ()

Added in API level 1

Public Methods

public String handleResponse ( HttpResponse response)

Added in API level 1

Returns the response body as a String 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 The response to process
Returns
  • A value determined by the response