From 3e6936c5a0a84dc6fa2d228716517d522f3b5687 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Thu, 21 Jan 2021 20:47:03 +0100 Subject: [PATCH] v 0.6: add Content-type in request header --- rest-api-client.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rest-api-client.sh b/rest-api-client.sh index ed27935..dbfb044 100644 --- a/rest-api-client.sh +++ b/rest-api-client.sh @@ -14,6 +14,7 @@ # 2020-02-07 v0.2 axel.hahn@iml.unibe.ch BETABETA # 2020-02-12 v0.4 axel.hahn@iml.unibe.ch Caching # 2020-03-02 v0.5 axel.hahn@iml.unibe.ch a few more response check functions +# 2021-01-21 v0.6 axel.hahn@iml.unibe.ch add Content-type in request header # ====================================================================== # --- fetch incoming params @@ -22,7 +23,7 @@ ApiUrl=$3 Body="$4" - http_cfg__about="Bash REST API client v0.5" + http_cfg__about="Bash REST API client v0.6" typeset -i http_cfg__debug=0 typeset -i http_cfg__cacheTtl=0 http_cfg__cacheDir=/var/tmp/http-cache @@ -185,6 +186,7 @@ EOH -A "${http_cfg__UA}" \ -w "${http_curl__writeout}" \ -H 'Accept: application/json' \ + -H 'Content-type: application/json' \ ${http_req__auth} \ -i "${http_req__fullurl}" \ -X "${http_req__method}" @@ -193,6 +195,7 @@ EOH -A "${http_cfg__UA}" \ -w "${http_curl__writeout}" \ -H 'Accept: application/json' \ + -H 'Content-type: application/json' \ ${http_req__auth} \ -i "${http_req__fullurl}" \ -X "${http_req__method}" \ -- GitLab