From 1b1f6f4a0b2fc36bb00be7d9752aa8d9f7824937 Mon Sep 17 00:00:00 2001 From: Chinenye Nmoh Date: Tue, 28 Oct 2025 07:33:01 +0100 Subject: [PATCH] corrected content type --- app/utils/auth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/utils/auth.py b/app/utils/auth.py index 7e69725..fa7fee0 100644 --- a/app/utils/auth.py +++ b/app/utils/auth.py @@ -17,9 +17,11 @@ def get_headers(): } logger.info(f"Calling Bank Call Auth endpoint: {url}") logger.info(f"Calling Bank Call Auth endpoint with data: {data}") + + headers = {"Content-Type": "application/json"} try: - response = requests.post(url, data=data, timeout=10) + response = requests.post(url, json=data, headers=headers, timeout=10) response.raise_for_status() # Raises HTTPError for 4xx/5xx result = response.json() @@ -34,7 +36,7 @@ def get_headers(): "Content-Type": "application/json", "x-api-key": settings.BANK_CALL_API_KEY, "App-Id": settings.BANK_CALL_APP_ID, - "Authorization": result['access_token'] + "Authorization": f"Bearer {result['access_token']}" } except requests.exceptions.RequestException as e: -- 2.34.1