From 15d6bab6714bea1a99560211e784213810c20544 Mon Sep 17 00:00:00 2001 From: Rabeco <106360860+Jayarr03@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:06:18 -0500 Subject: [PATCH] Add files via upload Updates to headers to include async operations. --- Integrations/Templates_Manager/templates_manager_v2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Integrations/Templates_Manager/templates_manager_v2.py b/Integrations/Templates_Manager/templates_manager_v2.py index 1c0a020..4ceca7a 100644 --- a/Integrations/Templates_Manager/templates_manager_v2.py +++ b/Integrations/Templates_Manager/templates_manager_v2.py @@ -69,7 +69,8 @@ } headers = { 'Accept': 'application/hal+json', - 'api-token': args.api_token + 'api-token': args.api_token, + 'X-Irius-Async': 'true' } response = requests.post(api_url_libraries, headers=headers, files=files) result_message = f"{file_name} imported as a library into {args.subdomain}. Status: {response.status_code}" @@ -86,8 +87,8 @@ } headers = { 'Accept': 'application/hal+json', - 'X-Irius-Async': 'false', - 'api-token': args.api_token + 'api-token': args.api_token, + 'X-Irius-Async': 'true' } response = requests.post(api_url_templates, headers=headers, files=files) result_message = f"{file_name} imported as a template into {args.subdomain}. Status: {response.status_code}"