I'm trying to attach photo to task using requests:
headers = {'X-Atlassian-Token': 'no-check',
'Authorization': 'Basic %s' % user_token,
'Content-Type': 'application/json'}
files = {'media': open(path_to_file, 'rb')}
url = "https://{}/rest/api/2/issue/{}/attachments".format(host, task_key)
result_attach = requests.post(url, files=files, headers=headers)
But I get reponse 415
415 seems weird since you're choosing a content type... Try removing the single quotes around 'no-check'. Or maybe try passing the header as a whole string?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.