def _api_request(self, endpoint, http_method, *args, **kwargs):
logger.debug('<STR_LIT>' % endpoint)<EOL>path = self._build_request_path(endpoint, absolute=False)<EOL>logger.debug('<STR_LIT>' % path)<EOL>data = None<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>data = kwargs['<STR_LIT>']<EOL><DEDENT>logger.debug('<STR_LIT>' % data)<EOL>command = {<EOL>"<STR_LIT:path>": path,<EOL>"<STR_LIT>": http_method<EOL>}<EOL>if data:<EOL><INDENT>command['<STR_LIT:body>'] = data<EOL><DEDENT>self._commands.append(command)<EOL>
Private method for api requests