+
+ if [ -z $HTTPX ]; then
+ if [ "$HTTPX" != "http" ] && [ "$HTTPX" != "https" ]; then
+ echo "Env var HTTPX shall be set to 'http' or 'https'"
+ echo "Exting test script....."
+ exit 1
+ fi
+ PROT="http"
+ else
+ PROT=$HTTPX
+ fi
+
+ req_content=""
+ if [ -z "$REQ_CONTENT" ]; then
+ if [ $# -gt 3 ]; then
+ req_content="-H Content-Type:application/json" #Assuming json
+ fi
+ else
+ req_content="-H Content-Type:$REQ_CONTENT"
+ fi
+ resp_content=""
+ if [ -z "$RESP_CONTENT" ]; then
+ if [[ "$RESULT" == "json"* ]]; then
+ resp_content="application/json"
+ elif [[ "$RESULT" == "*" ]]; then
+ resp_content=""
+ else
+ resp_content="text/plain"
+ fi
+ else
+ resp_content=$RESP_CONTENT
+ fi
+ curlstr="curl -X "$1" -skw :%{content_type}:%{http_code} ${PROT}://localhost:$PORT$2 -H accept:*/*"