You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
406 B

5 months ago
import requests
# 目标 URL
url = 'http://127.0.0.1:8000/polls/roll_call/'
5 months ago
5 months ago
data = {
5 months ago
'start_roll_call': 'true'
5 months ago
}
5 months ago
response = requests.post(url, json=data)
5 months ago
if response.status_code == 200:
try:
print("点名成功:", response.json())
except ValueError:
print("响应不是有效的 JSON:", response.text)
else:
print("点名失败:", response.status_code, response.text)