From 30233b7283933b6ace4947a1b6076e08cf947653 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 5 Apr 2025 21:14:03 -0400 Subject: [PATCH] test Header for basic auths --- app/api/integrations/simbrella.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/api/integrations/simbrella.py b/app/api/integrations/simbrella.py index e3ef62d..22ab804 100644 --- a/app/api/integrations/simbrella.py +++ b/app/api/integrations/simbrella.py @@ -35,10 +35,16 @@ class SimbrellaIntegration: } logger.error(f"This is PayLoad: {str(payload)}",exc_info=True) - auth = HTTPBasicAuth(settings.VALID_APP_ID, settings.VALID_API_KEY) + # auth = HTTPBasicAuth(settings.VALID_APP_ID, settings.VALID_API_KEY) + headers = { + 'Content-Type': 'application/json', + 'x-api-key': f'{settings.VALID_API_KEY}', + 'App-Id': f'{settings.VALID_APP_ID}' + } try: - response = requests.post(url, json=payload, timeout=10, auth=auth) + + response = requests.post(url, json=payload, timeout=10, headers=headers) logger.error(f"This is Response: {str(response)}", exc_info=True) # Raise an error for non-200 responses response.raise_for_status()