1 import requests 2 files = {'file':open('D://tomas.jpg','rb')}#设定一个files,打开文件对象 3 response = requests.post('http://httpbin.org/post',files=files) 4 print(response.text)
1 import requests 2 files = {'file':open('D://tomas.jpg','rb')}#设定一个files,打开文件对象 3 response = requests.post('http://httpbin.org/post',files=files) 4 print(response.text)