Skip to content

Commit 41a80ef

Browse files
authored
Merge pull request #4 from txt-file/patch-1
ensure UTF-8 communication in call_api
2 parents 5f7db11 + 7c04fcf commit 41a80ef

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)