From e189ba0ca457f17e057dbb5af44a57f3bccfe43d Mon Sep 17 00:00:00 2001 From: GU-0 Date: Thu, 10 Oct 2024 14:19:48 +0900 Subject: [PATCH] Edit 'send_post_request' for Oasis --- airflow/requirements/modules.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/airflow/requirements/modules.py b/airflow/requirements/modules.py index b610a5b..90d9a92 100644 --- a/airflow/requirements/modules.py +++ b/airflow/requirements/modules.py @@ -34,11 +34,12 @@ def send_post_request(platform, categoryId): url = "" if platform == 'HP': url = os.getenv("HOMEPLUS_SERVICE_URL") + headers = {"Content-Type": "application/json"} + data = json.dumps({"category_id": categoryId}) + response = requests.post(url, headers=headers, data=data) elif platform == 'OA': url = os.getenv("OASIS_SERVICE_URL") - headers = {"Content-Type": "application/json"} - data = json.dumps({"category_id": categoryId}) - response = requests.post(url, headers=headers, data=data) + response = requests.post(url) if response.status_code == 200: print(f"Success: {response.json()}")