code: protected Response doRequest(HttpRequestBase request, String authorizationToken, Class<?> successResponseClass) {
  
  		assertValid(authorizationToken, "An authorizationToken is required for web resource call");
  
  		CloseableHttpClient httpclient = HttpClients.createDefault();
  		request.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
  		request.setHeader(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
  		request.setHeader("Authorization", "Token " + authorizationToken);
  		
  		try {
  			CloseableHttpResponse clientResponse = httpclient.execute(request);
  		
  		    HttpEntity entity = clientResponse.getEntity();
  
  		    InputStream inputStream = entity.getContent();
  
  		    StringWriter writer = new StringWriter();
  		    IOUtils.copy(inputStream, writer, "UTF-8");
  		    String json = writer.toString();
  		    
  		    LOG.debug("json: " + json);
  		    
  			Response response = (Response) OBJECT_MAPPER.readValue(json, successResponseClass);
  
  			LOG.debug("response.statuscode: " + response.status_code);
  			
  			if (!StatusCode.SUCCESS.equals(response.status_code)) {
  
  				throw new RuntimeException(response.toString());
  			}
  
  			Header totalCount = clientResponse.getFirstHeader("X-Total-Count");
  			if (totalCount != null) {
  				response.totalCount = Integer.valueOf(totalCount.getValue());
  			}
  		    EntityUtils.consume(entity);
  			clientResponse.close();
  		    
  			LOG.debug("Response: " + response);
  		    
  			return response;
  
  		} catch (ClientProtocolException e) {
  			throw new RuntimeException(e);
  		} catch (JsonParseException e) {
  			throw new RuntimeException(e);
  		} catch (JsonMappingException e) {
  			throw new RuntimeException(e);
  		} catch (IOException e) {
  			throw new RuntimeException(e);
  		}
  	}
docs: doRequest
  
  @param request
  @param authorizationToken
  @param successResponseClass
  @return