From 6a8e9e6ed62d6e93fc8eeaf3c5f7d42df2e08e65 Mon Sep 17 00:00:00 2001 From: navrotskyj Date: Fri, 11 Oct 2019 17:11:13 +0300 Subject: [PATCH] httpRequest - allow replace response content-type --- src/call/http_request.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/call/http_request.go b/src/call/http_request.go index af0827f..def306a 100644 --- a/src/call/http_request.go +++ b/src/call/http_request.go @@ -141,7 +141,10 @@ func HttpRequest(c *Call, args interface{}) error { return nil } - str = res.Header.Get("content-type") + if str = getStringValueFromMap("parser", props, ""); str == "" { + str = res.Header.Get("content-type") + } + if strings.Index(str, "application/json") > -1 { if _, ok = props["exportVariables"]; ok { if _, ok = props["exportVariables"].(map[string]interface{}); ok {