标签:文件名 exce repo request port 请求头 图片 org http
url = ‘http://httpbin.org/post‘
files = {‘file‘: open(‘report.xls‘, ‘rb‘)}
r = requests.post(url, files=files)
#你可以显式地设置文件名,文件类型和请求头:
url = ‘http://httpbin.org/post‘
files = {‘file‘: (‘report.xls‘, open(‘report.xls‘, ‘rb‘), ‘application/vnd.ms-excel‘, {‘Expires‘: ‘0‘})}
r = requests.post(url, files=files)
标签:文件名 exce repo request port 请求头 图片 org http
原文地址:https://www.cnblogs.com/xiaobaibailongma/p/12346209.html