def json(self, **kwargs):
    'Returns the json-encoded content of a response, if any.\n\n        :param \\*\\*kwargs: Optional arguments that ``json.loads`` takes.\n        :raises ValueError: If the response body does not contain valid json.\n        '
    if ((not self.encoding) and self.content and (len(self.content) > 3)):
        encoding = guess_json_utf(self.content)
        if (encoding is not None):
            try:
                return complexjson.loads(self.content.decode(encoding), **kwargs)
            except UnicodeDecodeError:
                pass
    return complexjson.loads(self.text, **kwargs)
Returns the json-encoded content of a response, if any.

:param \*\*kwargs: Optional arguments that ``json.loads`` takes.
:raises ValueError: If the response body does not contain valid json.
def json(self, **kwargs):
    'Returns the json-encoded content of a response, if any.\n\n        :param \\*\\*kwargs: Optional arguments that ``json.loads`` takes.\n        :raises ValueError: If the response body does not contain valid json.\n        '
    if ((not self.encoding) and self.content and (len(self.content) > 3)):
        encoding = guess_json_utf(self.content)
        if (encoding is not None):
            try:
                return complexjson.loads(self.content.decode(encoding), **kwargs)
            except UnicodeDecodeError:
                pass
    return complexjson.loads(self.text, **kwargs)