From 268fed655fc47d99113b166a84396dbb38140b80 Mon Sep 17 00:00:00 2001 From: Giga77 <2777446+Giga77@users.noreply.github.com> Date: Fri, 15 Mar 2024 19:26:24 +0100 Subject: [PATCH] fix data --- custom_components/ecole_directe/ecoleDirecte_helper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/custom_components/ecole_directe/ecoleDirecte_helper.py b/custom_components/ecole_directe/ecoleDirecte_helper.py index 4c86c1a..c23f7bf 100644 --- a/custom_components/ecole_directe/ecoleDirecte_helper.py +++ b/custom_components/ecole_directe/ecoleDirecte_helper.py @@ -32,6 +32,9 @@ def getResponse(session, url, data): else: token = None + if data is None: + data = "{" + "}" + _LOGGER.debug("URL: [%s] - Data: [%s]", url, data) response = requests.post(url, data=data, headers=getHeaders(token)) @@ -166,7 +169,7 @@ def getHomeworkByDate(session, eleve, date): return getResponse( session, f"{APIURL}/eleves/{eleve.eleve_id}/cahierdetexte/{date}.awp?verbe=get&v={APIVERSION}", - "data={}", + None, ) @@ -174,7 +177,7 @@ def getHomework(session, eleve): return getResponse( session, f"{APIURL}/eleves/{eleve.eleve_id}/cahierdetexte.awp?verbe=get&v={APIVERSION}", - "data={}", + None, )