fix: add slice type of request body data

This commit is contained in:
xucong053
2022-02-24 15:24:58 +08:00
parent 0cef3f9ec2
commit 802e6052ff
2 changed files with 50 additions and 33 deletions

View File

@@ -716,6 +716,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: