#!/usr/bin/env python3 """快速测试API列表调用""" import requests from api_config import API_CONFIG from datetime import datetime def quick_test(): print("🚀 快速测试API列表调用") print("=" * 40) success = 0 total = 0 for api_key, config in API_CONFIG.items(): total += 1 print(f"\n📞 {api_key} ({config['method']})") try: if config['method'] == 'GET': resp = requests.get(config['url'], headers=config['headers'], params=config['body'], timeout=config['timeout']) elif config['method'] == 'POST': resp = requests.post(config['url'], headers=config['headers'], json=config['body'], timeout=config['timeout']) elif config['method'] == 'PUT': resp = requests.put(config['url'], headers=config['headers'], json=config['body'], timeout=config['timeout']) else: resp = requests.delete(config['url'], headers=config['headers'], timeout=config['timeout']) if resp.status_code in [200, 201, 204]: print(f" ✅ 成功 - 状态码: {resp.status_code}") success += 1 else: print(f" ❌ 失败 - 状态码: {resp.status_code}") except Exception as e: print(f" ❌ 异常: {str(e)[:50]}") print(f"\n📊 结果: {success}/{total} 成功") if __name__ == "__main__": quick_test()