I have a file called sth.py with following content:
print('20')
print(2+3)
when I make a curl
curl -u log:pass -T filepath http://something/sth.py
everything works great, when I download the file later It looks the same, when I do it with python requests like that:
files = {'sth.py': open(filepath, 'rb')}
auth = (log, pass)
r = requests.post('http://something/sth.py', files=files, auth=auth)
It also gets uploaded, but after I download it from the server it looks like this:
--3541f6ca4fc1fc7a26a3bef9ee42edcc
Content-Disposition: form-data; name="sth.py"; filename="sth.py"
print('20')
print(2+3)
--3541f6ca4fc1fc7a26a3bef9ee42edcc--
What's the problem?