private HttpResponse executeRequest(final HttpUriRequest request, final String url) throws RestClientException {
		final HttpClient client = new DefaultHttpClient();
		try {
		    if( LOG.isDebugEnabled()){
		        LOG.debug(String.format("Making HTTP %s request to '%s'", request.getMethod(), url));
		    }
			try {
				httpResponse = client.execute(request);
	            if( LOG.isDebugEnabled()){
	                LOG.debug(String.format("Request completed with http status %s",httpResponse.getStatusLine().getStatusCode()));
	            }
			} catch (final Exception e) {
				throw new RestClientException("Error sending request to server", e);
			}

			responseCode = httpResponse.getStatusLine().getStatusCode();
			message = httpResponse.getStatusLine().getReasonPhrase();

			final HttpEntity entity = httpResponse.getEntity();

			if (entity != null) {
				InputStream is = null;
				try {
					is = entity.getContent();
					response = IOUtils.toString(is);
					// Closing the input stream will trigger connection release
				} catch (final Exception e) {
					throw new RestClientException("Error reading response from server",e);
				} finally {
					IOUtils.closeQuietly(is);
				}
			}
		    if( HttpStatus.GATEWAY_TIMEOUT.equalsCode(responseCode)){
                throw new RestClientException("Timed out contatcing server. Http Status" + HttpStatus.GATEWAY_TIMEOUT );
	        }
			return httpResponse;
		}  finally {
			if (client != null) {
				try {
					client.getConnectionManager().shutdown();
				} catch (final Exception e) {
				    LOG.warn("Error shutting down rest client",e);
					//throw new RestClientException("Error shutting down rest client",e);
				}
			}
		}
	}