diff --git a/src/edutap/wallet_google/api.py b/src/edutap/wallet_google/api.py index 3550c76..e9e16d4 100644 --- a/src/edutap/wallet_google/api.py +++ b/src/edutap/wallet_google/api.py @@ -91,7 +91,7 @@ def create( resource_id, verified_json = _validate_data_and_convert_to_json(model, data) session = session_manager.session url = session_manager.url(name) - response = session.post(url=url, json=verified_json.encode("utf-8")) + response = session.post(url=url, json=verified_json) if response.status_code == 409: raise Exception( f"Wallet Object {name} {getattr(data, 'id', 'No ID')} already exists\n{response.text}" @@ -177,12 +177,12 @@ def update( if partial: response = session.patch( url=session_manager.url(name, f"/{resource_id}"), - json=verified_json.encode("utf-8"), + json=verified_json, ) else: response = session.put( url=session_manager.url(name, f"/{resource_id}"), - json=verified_json.encode("utf-8"), + json=verified_json, ) logger.debug(verified_json.encode("utf-8")) if response.status_code == 404: @@ -251,7 +251,7 @@ def message( ) session = session_manager.session url = session_manager.url(name, f"/{resource_id}/addMessage") - response = session.post(url=url, json=verified_json.encode("utf-8")) + response = session.post(url=url, json=verified_json) if response.status_code == 404: raise LookupError(f"Error 404, {name} not found: - {response.text}")