def _request(self, method, path, **kwargs):
        request_url = self.get_base_url() + path
        request = Request(method, request_url, params=kwargs.get("params"))
        logger.debug("Executing request to {0}".format(request_url))

        if 'auth' in kwargs:
            # If using HTTP basic auth, let requests handle it
            request.use_http_auth(*kwargs['auth'])
        else:
            # Default to using bearer auth with the access token
            request.use_bearer_auth(self._access_token)

        request.set_payload(kwargs.get('data'))
        response = request.perform()
        if type(response) == dict and "errors" in response.keys():
            raise ClientError("Error calling api, message was ",
                response["errors"])
        if type(response) == dict and "error" in response.keys():
            raise ClientError("Error calling api, message was ",
                response["error"])
        return response
Send a request to the GoCardless API servers.
dataset/ETHPy150Open gocardless/gocardless-python/gocardless/client.py/Client._request