From 03f7e8bac8ed5ca3fe6af9594ff886805c434983 Mon Sep 17 00:00:00 2001 From: Carlos Romero <98657335+carom93@users.noreply.github.com> Date: Mon, 23 Mar 2026 14:32:29 -0600 Subject: [PATCH] Change HTTP method to PUT for file upload --- deploy_to_wazuh.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy_to_wazuh.py b/deploy_to_wazuh.py index c33fd8d..3033998 100644 --- a/deploy_to_wazuh.py +++ b/deploy_to_wazuh.py @@ -30,8 +30,8 @@ def upload_file(token, endpoint, filename, content): "Authorization": f"Bearer {token}", "Content-Type": "application/octet-stream" } - params = {"filename": filename, "overwrite": True} - response = requests.post( + params = {"filename": filename, "overwrite": "true"} + response = requests.put( f"{WAZUH_URL}/{endpoint}", headers=headers, params=params, @@ -43,7 +43,7 @@ def upload_file(token, endpoint, filename, content): else: print(f"❌ Failed to upload {filename}: {response.status_code} - {response.text}") raise Exception(f"Upload failed for {filename}") - + def main(): token = get_token() print("🔐 Authenticated with Wazuh API")