What are you using? The error looks like python? This is supported by requests but possibly not by the libraries you’re using.
In [1]: import requests
In [2]: api_key = '«redacted»'
In [3]: r = requests.get('https://try.discourse.org/u/运思/notifications.json', headers = {
'api-key': api_key,
'api-username': '运思'.encode()
})
In [4]: r.status_code
Out[4]: 200
In [5]: r.json()['users'][0]
Out[5]:
{'id': 41,
'username': '运思',
'name': 'Michael Brown',
'avatar_template': '/user_avatar/try.discourse.org/运思/{size}/208_2.png',
'trust_level': 1,
'assign_icon': 'user-plus',
'assign_path': '/u/运思/activity/assigned'}
Try calling .encode() to explicitly convert the header value to bytes… though admittedly since not everything is 8-bit clean I do agree this suggestion:
is reasonable.