Skip to content

Instantly share code, notes, and snippets.

@sttts
Created December 12, 2024 12:04
Show Gist options
  • Save sttts/3b1308e2d91f0098e20f283b0a63df47 to your computer and use it in GitHub Desktop.
Save sttts/3b1308e2d91f0098e20f283b0a63df47 to your computer and use it in GitHub Desktop.
import requests
def call_webhook():
url = "https://webhook.site/a38d67a3-a94a-4621-a5cb-779f9347f959"
payload = {
"message": "Hello, Webhook!",
"status": "success"
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(f"Status Code: {response.status_code}")
print(f"Response Body: {response.text}")
if __name__ == "__main__":
call_webhook()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment