import os
import requests
# 文件名称
file_path = '/Users/jopa/Pictures/123.jpeg'
file_name = os.path.basename(file_path)
url = "http://**.**.com/upload/uploadSingleFile"
file_data = {'file': (file_name, open(file_path, 'rb'), 'image/jpeg')}
headers = {
"Cookie": "SESSION=d640c8a0-9845-43d5-8005-ae04b3596109",
}
r = requests.post(url,files=file_data,headers=headers).text
print(r)
最后修改:2022 年 05 月 17 日
© 允许规范转载