async def _make_request(self): url = "https://chatbase.com/api/message" async with aiohttp.ClientSession() as session: async with session.post(url, data=self.to_json(), headers=Message.get_content_type()) as response: logger.info(f"Chatbase response {response}") return response
def send(self): """Send the message set to the Chatbase API""" try: url = ("https://chatbase.com/api/messages?api_key=%s" % self.api_key) requests.post(url, data=self.to_json(), headers=Message.get_content_type()) except HTTPError: pass