'Returns the json-encoded content of a response, if any.'

def json(self):

    if ((not self.encoding) and (len(self.content) > 3)):
        encoding = guess_json_utf(self.content)
        if (encoding is not None):
            return json.loads(self.content.decode(encoding))
    return json.loads((self.text or self.content))
