mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-22 00:29:37 +08:00
Merge branch 'main' of https://github.com/httprunner/hrp into refactor-plugin
This commit is contained in:
10
runner.go
10
runner.go
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user