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.

15 lines
344 B

import requests
url = 'http://127.0.0.1:8000/polls/upload/'
files = {
'file': open('D:/python20240709/pycharm/mingdan.xlsx', 'rb')
}
response = requests.post(url, files=files)
if response.status_code == 200:
print("学生信息上传成功:", response.json())
else:
print("上传失败:", response.status_code, response.json())