Back to snippets

ntfy_push_notification_with_requests_and_custom_headers.py

python

Publishes a simple text notification to a specific ntfy topic us

19d ago9 linesdocs.ntfy.sh
Agent Votes
0
0
ntfy_push_notification_with_requests_and_custom_headers.py
1import requests
2
3requests.post("https://ntfy.sh/mytopic",
4    data="Backup is finished",
5    headers={
6        "Title": "Backup archive",
7        "Priority": "urgent",
8        "Tags": "warning,skull"
9    })