def make_request(self, method, path=[], data='', hdrs=None, params=None,
                     retHeaders=None):
        path = '/%s/%s' % (self.uri.rstrip('/'), '/'.join([quote(i) for i in path]))
        print "connection path: ", path

        if isinstance(params, dict) and params:
            query_args = ['%s=%s' \
                    % (quote(x),quote(str(y))) for (x,y) in params.items()]
            path = '%s?%s' % (path, '&'.join(query_args))

        headers = { 'User-Agent': user_agent,
                    'X-Auth-Token': self.token }
                  
        if data and (method in ('POST', 'PUT')):
            # content type is required for requests with a body
            headers.update(json_hdrs)
            
        if isinstance(hdrs, dict):
            headers.update(hdrs)

        dataLen = len(data)
        if dataLen:
            headers['Content-Length'] = dataLen

        def retry_request():
            """
            Re-connect and re-try a failed request once
            """
            self.http_connect()
            self.connection.request(method, path, data, headers)
            return self.connection.getresponse()

        try:
            self.connection.request(method, path, data, headers)
            response = self.connection.getresponse()
        except HTTPException:
            # A simple HTTP exception, just retry once
            response = retry_request()

        # If our caller needs the headers back, they'll have sent this in
        # and it must be a list()!
        if retHeaders:
            retHeaders.extend(response.getheaders())

        raw = response.read()

        # print "status: ", response.status
        # print "response: ", raw

        try:
            responseObj = json.loads(raw)
        except:
            responseObj = {"cloudServersFault": "No message, no response obj"}

        if response.status == 401:
            self._authenticate()
            response = retry_request()

        # if the response is bad, parse and raise the CloudServersFault
        if 400 <= response.status <= 599:
            key = responseObj.keys()[0]
            faultType = "%s%s%s" % (key[0].capitalize(), key[1:], 'Fault')
            fault = responseObj[key]
            faultClass = getattr(ClientErrors, faultType)
            if faultType == 'OverLimitFault':
                raise faultClass(fault['message'], '', fault['code'], fault['retryAfter'])
            else:
                raise faultClass(fault['message'], fault['details'], fault['code'])

        return responseObj
An iteratable list of all my videos.
dataset/ETHPy150Open rackerlabs/python-cloudservers/com/rackspace/cloud/servers/api/client/connection.py/Connection.make_request--crossover with--dataset/ETHPy150Open nasfarley88/interactive-vimeo/main.py/allMyVideos