def json(self, **kwargs):
if not self.encoding and self.content and len(self.content) > <NUM_LIT:3>:<EOL><INDENT>encoding = guess_json_utf(self.content)<EOL>if encoding is not None:<EOL><INDENT>try:<EOL><INDENT>return complexjson.loads(<EOL>self.content.decode(encoding), **kwargs<EOL>)<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>return complexjson.loads(self.text, **kwargs)<EOL>
r"""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.