Code example for HttpResponseException

0
 
	@Override 
	public String handleResponse(final HttpResponse response) throws HttpResponseException, IOException {
		StatusLine statusLine = response.getStatusLine();
		if (statusLine.getStatusCode() >= 300) {
			throw new HttpResponseException(statusLine.getStatusCode(), statusLine.getReasonPhrase());
		} 
 
		HttpEntity entity = response.getEntity();
		return entity == null ? null : EntityUtils.toString(entity, "utf-8");
	} 
 
} 
Connect your IDE to all the code out there  Get Codota for Java