import urllib.request import json import sys sys.stdout.reconfigure(encoding='utf-8') tickets = [ { "id": "0af8e222-a4ac-4f73-9107-e60f34f2dc6b", "fixNote": "Der Wurf 'Bentley × Alexandria' wurde als fehlerhafter Import eines Zuchtvorfahren-Wurfs identifiziert und aus der Datenbank gelöscht. Bitte lade die Seite neu." }, { "id": "19bd35f4-9b5d-4eea-a15c-270776a4df1d", "fixNote": "Der Wurf 'Whiskey × Walpurgis' wurde als fehlerhafter Import eines Zuchtvorfahren-Wurfs identifiziert und aus der Datenbank gelöscht. Bitte lade die Seite neu." } ] for t in tickets: url = f"http://localhost:5179/feedback/{t['id']}" payload = { "status": "Resolved", "fixNote": t["fixNote"] } try: req = urllib.request.Request( url, data=json.dumps(payload).encode('utf-8'), headers={"Content-Type": "application/json"}, method="PUT" ) with urllib.request.urlopen(req) as res: print(f"Ticket {t['id']} -> Status: {res.status}") except Exception as e: print(f"Error on {t['id']}: {e}")