import requests
import time

# Give the server a moment
time.sleep(2)

try:
    print("Testing server with GET request...")
    response = requests.get("http://127.0.0.1:8090/?event_type=session_start&param1=PrintAndGIF", timeout=10)
    print(f"Status Code: {response.status_code}")
    print(f"Response: {response.text}")
    
    print("\nTesting countdown request...")
    response2 = requests.get("http://127.0.0.1:8090/?event_type=countdown&param1=30", timeout=10)
    print(f"Status Code: {response2.status_code}")
    print(f"Response: {response2.text}")
    
    print("\nTesting file_download request...")
    response3 = requests.get("http://127.0.0.1:8090/?event_type=file_download&param1=20250926_222756_010.jpg", timeout=10)
    print(f"Status Code: {response3.status_code}")
    print(f"Response: {response3.text}")
    
except requests.exceptions.ConnectionError as e:
    print(f"Connection error: {e}")
except Exception as e:
    print(f"Error: {e}")