code: private HttpClient getClient(int retries, int connectionTimeout, int socketTimeout) {
          HttpClient httpClient = new DefaultHttpClient();
          HttpParams httpParams = httpClient.getParams();
  
          // Retries
          if (retries > 0) {
              DefaultHttpRequestRetryHandler retryHandler = new DefaultHttpRequestRetryHandler(retries, true);
              ((AbstractHttpClient) httpClient).setHttpRequestRetryHandler(retryHandler);
          }
  
          // Timeouts
          if (connectionTimeout > 0) {
              httpParams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout);
          }
          if (socketTimeout > 0) {
              httpParams.setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);
          }
  
          //Proxy
          if (StringUtils.isNotEmpty(proxyHostName)) {
              HttpHost proxy = new HttpHost(proxyHostName, proxyPort);
              httpParams.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
          }
  
          return httpClient;
      }
docs: Returns a DefaultHttpClient instance with retries and timeouts settings
  If proxy information exists, its setted on the client.
  
  @param retries                   int with the retries for the api request
  @param connectionTimeout         int with the connection timeout for the api request expressed in milliseconds
  @param socketTimeout             int with the socket timeout for the api request expressed in milliseconds
  @return                          a DefaultHttpClient