Files
dashboard/backend/test_api.py
T
2026-03-04 18:17:34 +08:00

18 lines
574 B
Python

import requests
import json
try:
response = requests.get("http://localhost:8001/api/brands/", params={"skip": 0, "limit": 10})
print(f"Status Code: {response.status_code}")
print(f"Content-Type: {response.headers.get('content-type')}")
print(f"Response: {response.text[:500]}")
if response.status_code == 200:
data = response.json()
print(f"\nSuccess! Got {len(data)} brands")
for brand in data[:5]:
print(f" - {brand}")
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()