Hello all. I have some trouble with REST API.
If I use comment with non-ANSI (cyrillic) characters for attachment, l get comment with incorrect encoding.
Python code:
from requests import Session
from requests.auth import HTTPBasicAuth
params = {'allowDuplicated': 'true'}
data = {
'comment': 'Тестовий коментар / Test comment',
# 'type': 'text/plain;charset=utf-8', #this line doesn"t change anything
'minorEdit': 'true'
}
files = {'file': ('testfile.txt', open('testfile.txt', 'rb'), 'application/binary')}
session = Session()
session.auth = HTTPBasicAuth('login', 'password')
session.headers['X-Atlassian-Token'] = 'no-check'
page_id=9765696
resp = session.post(f'http://confluence.alfa.bank.int/rest/api/content/{page_id}/child/attachment/', params=params, data=data, files=files).json()
print(resp['results'][0]['version']['message'])
Got comment:
ТеÑтовий коментар / Test comment
Any ideas?
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.