Skip to content

Commit 7c04fcf

Browse files
author
Matthias Fritzsche
committed
ensure UTF-8 communication in call_api
1 parent 5f7db11 commit 7c04fcf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

INWX/Domrobot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ def call_api(self, api_method, method_params=None):
121121
raise Exception('Invalid ApiType.')
122122

123123
headers = {
124-
'Content-Type': 'text/xml',
124+
'Content-Type': 'text/xml; charset=UTF-8',
125125
'User-Agent': 'DomRobot/' + ApiClient.CLIENT_VERSION + ' (Python ' + self.get_python_version() + ')'
126126
}
127127

128-
response = self.api_session.post(self.api_url + self.api_type.value, data=payload, headers=headers)
128+
response = self.api_session.post(self.api_url + self.api_type.value, data=payload.encode('UTF-8'), headers=headers)
129129

130130
if self.debug_mode:
131131
print('Request (' + api_method + '): ' + payload)

0 commit comments

Comments
 (0)