I have the following code to upload a file to my account:
import requests
TOKEN = '#######################################'
FILEPATH = 'files/path/home/ArtyBot/web'
API = 'https://www.pythonanywhere.com/api/v0/user/ArtyBot/'
res = requests.post(API + FILEPATH + '/app.py',
params={'content': 'import flask'},
headers={'Authorization': 'Token ' + TOKEN})
print(res)
print(res.json())
However I think I have done it wrong as I receive the following output:
<Response [400]>
{'detail': "You must provide a file with the name 'content'."}
I am quite new to using APIs, how should I do what I am trying to achieve?