Hi --
I have a 50meg windows installer for my product, that sits in the Downloads page of my project. I think this is what Bitbucket calls a "download artifact". Last year -- before Bitbucket started requiring app passwords -- I had no trouble uploading the installer to my Downloads page (I used Insomnia to send the HTML post),
After Bitbucket switched to app passwords, I generated an app password for my project and am able to git my code up/down from the server. But the upload of the download artifact fails. In an effort to solve that, I gave up on Insomnia and wrote a python script. Here's the script:
import requests
#url = 'http://httpbin.org/post'
url = 'https://api.bitbucket.org/2.0/repositories/alcramer/comiola/downloads'
headers = {
"Authorization": "Bearer MY_APP_PASSWORD"
}
files = {'file': open('test.txt', 'rb')}
r = requests.post(url, headers=headers, files=files)
print(r.text)
Bitbucket gives this response:
{"type": "error", "error": {"message": "Access token expired."}}
How do I fix this?
Thanks!
Al Cramer