open-webui/backend/utils/webhook.py

12 lines
231 B
Python
Raw Normal View History

2024-03-21 01:35:02 +00:00
import requests
def post_webhook(url: str, json: dict) -> bool:
try:
r = requests.post(url, json=json)
r.raise_for_status()
return True
except Exception as e:
print(e)
return False