Merge branch 'main' of https://github.com/httprunner/hrp into refactor-plugin

This commit is contained in:
debugtalk
2022-02-24 18:53:38 +08:00
2 changed files with 50 additions and 33 deletions

View File

@@ -720,6 +720,16 @@ func (r *caseRunner) runStepRequest(step *TStep) (stepResult *stepData, err erro
req.Header.Set("Content-Type", "application/json; charset=utf-8")
}
}
case []interface{}:
contentType := req.Header.Get("Content-Type")
// post json
dataBytes, err = json.Marshal(vv)
if err != nil {
return stepResult, err
}
if contentType == "" {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
}
case string:
dataBytes = []byte(vv)
case []byte: