#!/usr/bin/env python3
"""直接通过 HTTP 测试血缘可视化 API"""

import json

import requests

url = "http://localhost:5500/api/dataservice/products/5/lineage-visualization"
data = {"sample_data": {"用户ID": 12345, "姓名": "张三"}}

print(f"Testing URL: {url}")
print(f"Request data: {json.dumps(data, ensure_ascii=False)}")

try:
    response = requests.post(url, json=data)
    print(f"\nStatus: {response.status_code}")
    print(f"Response:\n{json.dumps(response.json(), ensure_ascii=False, indent=2)}")
except Exception as e:
    print(f"Error: {e}")
