adjusted content type #51

Merged
ameye merged 1 commits from test into master 2025-10-28 08:21:06 +00:00
+4 -2
View File
@@ -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: