def _http_response(self, url, method, data=None, content_type=None,<EOL>schema=None, **kwargs):
if schema is None:<EOL><INDENT>schema = self.schema_2<EOL><DEDENT>header = {<EOL>'<STR_LIT>': content_type or '<STR_LIT:application/json>',<EOL>'<STR_LIT>': schema,<EOL>}<EOL>auth = self.auth<EOL>token_required = auth.token_required<EOL>token = auth.token<EOL>desired_scope = auth.desired_scope<EOL>scope = auth.scope<EOL>if token_required:<EOL><INDENT>if not token or desired_scope != scope:<EOL><INDENT>logger.debug("<STR_LIT>", desired_scope)<EOL>auth.get_new_token()<EOL><DEDENT>header['<STR_LIT>'] = '<STR_LIT>' % self.auth.token<EOL><DEDENT>if data and not content_type:<EOL><INDENT>data = json.dumps(data)<EOL><DEDENT>path = url.format(**kwargs)<EOL>logger.debug("<STR_LIT>", method.__name__.upper(), path)<EOL>response = method(self.host + path,<EOL>data=data, headers=header, **self.method_kwargs)<EOL>logger.debug("<STR_LIT>", response.status_code, response.reason)<EOL>response.raise_for_status()<EOL>return response<EOL>
url -> full target url
           method -> method from requests
           data -> request body
           kwargs -> url formatting args