Skip to content
Snippets Groups Projects
Commit 3e6936c5 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

v 0.6: add Content-type in request header

parent f476a6be
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
# 2020-02-07 v0.2 axel.hahn@iml.unibe.ch BETABETA # 2020-02-07 v0.2 axel.hahn@iml.unibe.ch BETABETA
# 2020-02-12 v0.4 axel.hahn@iml.unibe.ch Caching # 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 # 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 # --- fetch incoming params
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
ApiUrl=$3 ApiUrl=$3
Body="$4" 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__debug=0
typeset -i http_cfg__cacheTtl=0 typeset -i http_cfg__cacheTtl=0
http_cfg__cacheDir=/var/tmp/http-cache http_cfg__cacheDir=/var/tmp/http-cache
...@@ -185,6 +186,7 @@ EOH ...@@ -185,6 +186,7 @@ EOH
-A "${http_cfg__UA}" \ -A "${http_cfg__UA}" \
-w "${http_curl__writeout}" \ -w "${http_curl__writeout}" \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-type: application/json' \
${http_req__auth} \ ${http_req__auth} \
-i "${http_req__fullurl}" \ -i "${http_req__fullurl}" \
-X "${http_req__method}" -X "${http_req__method}"
...@@ -193,6 +195,7 @@ EOH ...@@ -193,6 +195,7 @@ EOH
-A "${http_cfg__UA}" \ -A "${http_cfg__UA}" \
-w "${http_curl__writeout}" \ -w "${http_curl__writeout}" \
-H 'Accept: application/json' \ -H 'Accept: application/json' \
-H 'Content-type: application/json' \
${http_req__auth} \ ${http_req__auth} \
-i "${http_req__fullurl}" \ -i "${http_req__fullurl}" \
-X "${http_req__method}" \ -X "${http_req__method}" \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment