So I have this example from https://www.file.io/
$ curl -F "file=@test.txt" https://file.io
How do I use this in python? I tried this:
from requests import post
from urllib import request
from base64 import b64encode
with open('files/some_name.mp4', 'rb') as img:
encoded_img = b64encode(img.read())
r = post(url='https://file.io', data={'file' : encoded_img})
r = r.json()
print(r)
And got {'success': False, 'error': 400, 'message': 'Trouble uploading file'}