def send_http_notification(url: str, in_data: Any):
out_data = json.dumps(in_data)
try:
async with aiohttp.ClientSession() as session:
async with session.post(url, data=out_data, timeout=10) as resp:
if resp.status != 200:
log.msg('Error sending http notification: http status %s' % (str(resp.status)),
'NOTIFICATION')
except aiohttp.ClientError as e:
log.msg('Error sending http notification: %s' % (str(e)), 'NOTIFICATIONS')
评论列表
文章目录