first basic auth

This commit is contained in:
2025-01-05 21:45:09 +01:00
parent 62847f569d
commit 4896c63b1a
3 changed files with 42 additions and 4 deletions

View File

@ -9,9 +9,16 @@ import json
import argparse
import random
token = "ich-bin-da-token"
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json", # Adjust if needed for your payload format
}
def send_post_request(uri, data):
try:
requests.post(uri, json=data, timeout=1)
requests.post(uri, json=data, timeout=1, headers=headers)
except requests.exceptions.RequestException as e:
pass