def _response_parser(self, r, expect_json=True, ignore_content=False):
        if r.ok:
            try:
                j = r.json()
                return Response(j.get('state'), j)
            except ValueError:
                # No JSON-encoded data returned
                if expect_json:
                    logger = logging.getLogger(conf.LOGGING_API_LOGGER)
                    logger.debug(r.text)
                    raise InvalidAPIAccess('Invalid API access.')
                # Raw response
                if ignore_content:
                    res = Response(True, None)
                else:
                    res = Response(True, r.text)
                return res
        else:
            r.raise_for_status()
:param :class:`requests.Response` r: a response object of the Requests
dataset/ETHPy150Open shichao-an/115wangpan/u115/api.py/RequestHandler._response_parser