RIP
Tutorial
Tags
Topics
Examples
eBooks
Tutorial by Examples
Simple File Upload
url = 'http://your_url' files = {'file': open('myfile.test', 'rb')} r = requests.post(url, files=files)
File Upload w/ Manual Params
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)
Sending Strings as FIles
url = 'http://httpbin.org/post' files = {'file': ('report.csv', 'some,data,to,send\nanother,row,to,send\n')} r = requests.post(url, files=files) r.text
Page 1 of 1
1
Cookie
This website stores cookies on your computer.
We use cookies to enhance your experience on our website and deliver personalized content.
For more details on our cookie usage, please review our
Cookie Policy
and
Privacy Policy
Accept all Cookies
Leave this website