import requests
from requests.auth import HTTPBasicAuth
auth = HTTPBasicAuth('username','password')
url = 'http://localhost:2990/jira/rest/plugins/1.0?'
print(url)
# disable xsrf check
headers = {'X-Atlassian-Token':'no-check'}
#we first GET the URL to get the UPM Token
r = requests.get(url,auth=auth)
print(r.headers)
upm_token = r.headers.get('upm-token')
print(upm_token)
files = {'plugin': open('upraisepeople.server-1.0.8.jar','rb')}
requests.post(
# shove that UPM token at the end of the url
url+'?token='+upm_token,
files=files,
headers=headers,
auth=auth
)
I have above code for installing addon via python script but I cannot find upm-token in the headers. Any clue ..?