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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.