From c229c9dd8156dd70c020a1d5c381d5394fa001b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Fr=C3=A9rot?= Date: Sat, 28 Dec 2024 22:55:15 +0100 Subject: [PATCH] adding data to gitea api call function --- rtenets | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rtenets b/rtenets index e8bee88..45b096b 100755 --- a/rtenets +++ b/rtenets @@ -117,9 +117,17 @@ gitea() { local method="$1" local request="$2" - \curl -X "${request}" \ + local data="" + + if [[ $# > 3 ]]; then + data="$3" + fi + + \curl -s -X "${request}" \ -H "Content-Type: application/json" \ - -H "Authorization: token ${TOKEN}" "${ENDPOINT}/${method}" + -H "Authorization: token ${TOKEN}" \ + -d "${data}" \ + "${ENDPOINT}/${method}" } # ----------------- Git commands -----------------------