import requests import json # 测试连接到天勤服务器 def test_connect(): url = "http://127.0.0.1:8001/api/connect" data = { "username": "windsdreamer", "password": "1qazse42W3" } try: response = requests.post(url, json=data, timeout=10) print(f"Status code: {response.status_code}") print(f"Response: {response.json()}") except Exception as e: print(f"Error: {e}") if __name__ == "__main__": test_connect()