29 lines
758 B
Python
29 lines
758 B
Python
import requests
|
|
import json
|
|
|
|
# 禁用 SSL 警告
|
|
import urllib3
|
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
|
|
def test_mail_api():
|
|
print("开始测试邮箱API...")
|
|
|
|
try:
|
|
# 发送请求
|
|
response = requests.get(
|
|
'https://cursorapi.nosqli.com/admin/api.mail/getRandom',
|
|
verify=False,
|
|
proxies={"http": None, "https": None},
|
|
timeout=10
|
|
)
|
|
|
|
# 打印响应
|
|
print("\n状态码:", response.status_code)
|
|
print("\n响应内容:")
|
|
print(json.dumps(response.json(), indent=2, ensure_ascii=False))
|
|
|
|
except Exception as e:
|
|
print(f"\n请求失败: {str(e)}")
|
|
|
|
if __name__ == "__main__":
|
|
test_mail_api() |