18 lines
498 B
Python
18 lines
498 B
Python
#!/usr/bin/env python3
|
|
"""测试 wechat-crawl API 端点"""
|
|
import sys
|
|
sys.path.insert(0, '/home/ubuntu/nanocode/personal-blog/backend')
|
|
|
|
from fastapi.testclient import TestClient
|
|
from app import app
|
|
|
|
client = TestClient(app)
|
|
|
|
url = "https://mp.weixin.qq.com/s/_YqGx7J9XnyPe0GFhv4LYA"
|
|
print(f"测试 API: /api/wechat-crawl/preview")
|
|
print(f"URL: {url}\n")
|
|
|
|
res = client.post("/api/wechat-crawl/preview", json={"url": url})
|
|
print(f"状态码: {res.status_code}")
|
|
print(f"响应: {res.text[:2000]}")
|