requests上传post文件,python
import requests
def do_post():
url = 'http://127.0.0.1:8000/file/upload'
f = open(r'文件具体路径', 'rb')
files = {"file": f}
r = requests.post(url, files=files)
s = requests.session()
print(s.headers)
print(r.json())