async def request(self, method, path, json=None):
url = '<STR_LIT>'.format(self.host, self.port)<EOL>url += path.format(site=self.site)<EOL>try:<EOL><INDENT>async with self.session.request(method, url, json=json) as res:<EOL><INDENT>if res.content_type != '<STR_LIT:application/json>':<EOL><INDENT>raise ResponseError(<EOL>'<STR_LIT>'.format(res.content_type))<EOL><DEDENT>response = await res.json()<EOL>_raise_on_error(response)<EOL>return response['<STR_LIT:data>']<EOL><DEDENT><DEDENT>except client_exceptions.ClientError as err:<EOL><INDENT>raise RequestError(<EOL>'<STR_LIT>'.format(self.host, err)<EOL>) from None<EOL><DEDENT>
Make a request to the API.