您的curl请求将文件内容作为表单数据发送,而不是实际文件!您可能想要类似
with open('boot.txt', 'rb') as f: r = requests.post(url, data={'pxeconfig': f.read()})
您的curl请求将文件内容作为表单数据发送,而不是实际文件!您可能想要类似
with open('boot.txt', 'rb') as f: r = requests.post(url, data={'pxeconfig': f.read()})