I'd like to upload files to a server using python. That means in this case that when I write http://example.com/files/ in my browser I'd like to see de.txt there in the list of files. How should I change this script to be working? When I run it, python shell writes out nothing, only the >>>.
Thanks in advance!
import requests
url = 'http://example.com/files/'
user, password = 'ex', 'ample'
files = {'upload_file': open(r'C:\Users\example\Desktop\code\de.txt','rb')}
r = requests.post(url, auth=(user, password), files=files)