'Execute a request and return a response'

def execute(self, request):

    url = request.uri
    if request.parameters:
        url += ('?' + urlencode(request.parameters))
    if request.headers:
        headers = dict(self._headers, **request.headers)
    else:
        headers = self._headers
    retry = 0
    server = getattr(self._local, 'server', None)
    while True:
        if (not server):
            self._local.server = server = self._get_server()
        try:
            parse_result = urlparse(server)
            conn = get_pool().connection_from_host(parse_result.hostname, parse_result.port, parse_result.scheme)
            kwargs = dict(method=Method._VALUES_TO_NAMES[request.method], url=(parse_result.path + url), body=request.body, headers=headers, timeout=self._timeout)
            response = conn.urlopen(**kwargs)
            return RestResponse(status=response.status, body=response.data, headers=response.headers)
        except (IOError, urllib3.exceptions.HTTPError) as ex:
            self._drop_server(server)
            self._local.server = server = None
            if (retry >= self._max_retries):
                logger.error('Client    error:    bailing    out    after    %d    failed    retries', self._max_retries, exc_info=1)
                raise NoServerAvailable(ex)
            logger.exception('Client    error:    %d    retries    left', (self._max_retries - retry))
            retry += 1
