Always encode your Requests payloads in Python
At Bixoto, we use a lot of different APIs to interface with suppliers and other services. Today, I was working with an XML API using requests (via api_session) and xmltodict. TL;DR: use requests.post(url, data=my_string.encode(“utf-8”)) and not requests.post(url, data=my_string).Long version below: The simplified code looked like this: This worked great until I called client.hello() with a name that contained accents, such as “Élise”. The API … Read more