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
21 lines
406 B
import requests
|
|
|
|
# 目标 URL
|
|
url = 'http://127.0.0.1:8000/polls/roll_call/'
|
|
|
|
|
|
data = {
|
|
'start_roll_call': 'true'
|
|
}
|
|
|
|
response = requests.post(url, json=data)
|
|
|
|
|
|
if response.status_code == 200:
|
|
try:
|
|
print("点名成功:", response.json())
|
|
except ValueError:
|
|
print("响应不是有效的 JSON:", response.text)
|
|
else:
|
|
print("点名失败:", response.status_code, response.text)
|