From 89ac773c8ed6f20b6430a14723a137d29186f79c Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Wed, 12 Mar 2025 11:36:51 +0100 Subject: [PATCH] Brink api to dev back --- misc/api.func | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/misc/api.func b/misc/api.func index 15bde49..c56eb2d 100644 --- a/misc/api.func +++ b/misc/api.func @@ -38,7 +38,9 @@ post_to_api() { } EOF ) - + RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \ + -H "Content-Type: application/json" \ + -d "$JSON_PAYLOAD") || true } post_to_api_vm() { @@ -83,7 +85,9 @@ post_to_api_vm() { } EOF ) - + RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \ + -H "Content-Type: application/json" \ + -d "$JSON_PAYLOAD") || true } POST_UPDATE_DONE=false @@ -96,7 +100,7 @@ post_update_to_api() { if [ "$POST_UPDATE_DONE" = true ]; then return 0 fi - local API_URL="http://api.community-scripts.org/upload/updatestatus" + local API_URL="http://api.community-scripts.org/upload/updatestatus" local status="${1:-failed}" local error="${2:-No error message}" @@ -108,7 +112,9 @@ post_update_to_api() { } EOF ) - + RESPONSE=$(curl -s -w "%{http_code}" -L -X POST "$API_URL" --post301 --post302 \ + -H "Content-Type: application/json" \ + -d "$JSON_PAYLOAD") || true POST_UPDATE_DONE=true }