def request(self, method, *, path=None, json=None,
                params=None, headers=None, timeout=None,
                backoff_cap=None, **kwargs):
        """Performs an HTTP request with the given parameters.

           Implements exponential backoff.

           If `ConnectionError` occurs, a timestamp equal to now +
           the default delay (`BACKOFF_DELAY`) is assigned to the object.
           The timestamp is in UTC. Next time the function is called, it either
           waits till the timestamp is passed or raises `TimeoutError`.

           If `ConnectionError` occurs two or more times in a row,
           the retry count is incremented and the new timestamp is calculated
           as now + the default delay multiplied by two to the power of the
           number of retries.

           If a request is successful, the backoff timestamp is removed,
           the retry count is back to zero.

        Args:
            method (str): HTTP method (e.g.: ``'GET'``).
            path (str): API endpoint path (e.g.: ``'/transactions'``).
            json (dict): JSON data to send along with the request.
            params (dict): Dictionary of URL (query) parameters.
            headers (dict): Optional headers to pass to the request.
            timeout (int): Optional timeout in seconds.
            backoff_cap (int): The maximal allowed backoff delay in seconds
                               to be assigned to a node.
            kwargs: Optional keyword arguments.

        """
        backoff_timedelta = self.get_backoff_timedelta()

        if timeout is not None and timeout < backoff_timedelta:
            raise TimeoutError

        if backoff_timedelta > 0:
            time.sleep(backoff_timedelta)

        connExc = None
        timeout = timeout if timeout is None else timeout - backoff_timedelta
        try:
            response = self._request(
                method=method,
                timeout=timeout,
                url=self.node_url + path if path else self.node_url,
                json=json,
                params=params,
                headers=headers,
                **kwargs,
            )
        except ConnectionError as err:
            connExc = err
            raise err
        finally:
            self.update_backoff_time(success=connExc is None,
                                     backoff_cap=backoff_cap)
        return response
Performs an HTTP request with the given parameters.

           Implements exponential backoff.

           If `ConnectionError` occurs, a timestamp equal to now +
           the default delay (`BACKOFF_DELAY`) is assigned to the object.
           The timestamp is in UTC. Next time the function is called, it either
           waits till the timestamp is passed or raises `TimeoutError`.

           If `ConnectionError` occurs two or more times in a row,
           the retry count is incremented and the new timestamp is calculated
           as now + the default delay multiplied by two to the power of the
           number of retries.

           If a request is successful, the backoff timestamp is removed,
           the retry count is back to zero.

        Args:
            method (str): HTTP method (e.g.: ``'GET'``).
            path (str): API endpoint path (e.g.: ``'/transactions'``).
            json (dict): JSON data to send along with the request.
            params (dict): Dictionary of URL (query) parameters.
            headers (dict): Optional headers to pass to the request.
            timeout (int): Optional timeout in seconds.
            backoff_cap (int): The maximal allowed backoff delay in seconds
                               to be assigned to a node.
            kwargs: Optional keyword arguments.