python-rtkit
python-rtkit copied to clipboard
Comment API with attachment
Hello, it seems there are some issues with the comment API with Attachment. I am able to send .txt file but nothing else. Not even .JPG. I keep getting [ERROR] 'ascii' codec can't decode byte 0xef in position 407: ordinal not in range(128). Here is my code:
file_open = file(full_filename) content = {
"content": {
'id': _ticket,
'Action': 'comment',
'Text': comment_text,
'Attachment': uploaded_filename
},
'attachment_1': file_open
}
resource = RTResource(uri, username, password, CookieAuthenticator)
response = resource.post(path='ticket/' + _ticket + '/comment', payload=content, )
Any suggestion?