在准备环境前提交次全部更改。
This commit is contained in:
19
scripts/ops/test_mvp_api.py
Normal file
19
scripts/ops/test_mvp_api.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""快速验证 MVP API 接口"""
|
||||
import urllib.request
|
||||
import json
|
||||
|
||||
url = "http://127.0.0.1:8000/api/xcx-test"
|
||||
print(f"请求: GET {url}")
|
||||
|
||||
try:
|
||||
req = urllib.request.Request(url)
|
||||
with urllib.request.urlopen(req, timeout=5) as resp:
|
||||
data = json.loads(resp.read().decode())
|
||||
print(f"状态码: {resp.status}")
|
||||
print(f"响应: {data}")
|
||||
if data.get("ti") == "t91":
|
||||
print("✓ MVP API 验证通过!")
|
||||
else:
|
||||
print(f"✗ 期望 ti='t91',实际 ti='{data.get('ti')}'")
|
||||
except Exception as e:
|
||||
print(f"✗ 请求失败: {e}")
|
||||
Reference in New Issue
Block a user