'Returns the json-encoded content of a response, if any.
:param \*\*kwargs: Optional arguments that ``json.loads`` takes.'

def json(self, **kwargs):

    if ((not self.encoding) 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)
