def _request(self, method, body=None, raise_exc=True, headers=None):
        headers = headers or {}
        if body and 'Content-Type' not in headers:
            headers.update({'Content-Type': 'application/json'})
        response = self._core.session.request(
            method,
            self.uri,
            data=body if not isinstance(body, dict) else None,
            json=body if isinstance(body, dict) else None,
            headers=headers,
            allow_redirects=False,
        )
        nav = self._create_navigator(response, raise_exc=raise_exc)
        if raise_exc and not response:
            raise exc.HALNavigatorError(
                message=response.text,
                status=response.status_code,
                nav=nav,  # may be self
                response=response,
            )
        else:
            return nav
Get count of entries currently stored in cache
dataset/ETHPy150Open deontologician/restnavigator/restnavigator/halnav.py/HALNavigator._request--crossover with--dataset/ETHPy150Open tweepy/tweepy/tweepy/cache.py/Cache.count