Code example for HttpResponse

Methods: getEntitygetStatusLine

public abstract class JsonResponseHandler<T> implements ResponseHandler<T> {
	public abstract T handleJson(JSONObject response);
	public T handleResponse(HttpResponse response) throws ClientProtocolException, IOException {
		if (response == null || response.getStatusLine().getStatusCode() != 200) {
			return null; 
		try { 
			String responseString = NetworkUtils.toString(response.getEntity(), HTTP.UTF_8);
			return handleJson(new JSONObject(responseString));
		catch (IOException e) {
			Log.e("Server request failed.", e);
		catch (JSONException e) {
			Log.e("Failed to parse server response.", e);
Connect your IDE to all the code out there  Get Codota for Java