mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-24 01:40:02 +08:00
fix: handle non-json response body
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/imroc/req"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// run API test with default configs
|
||||
@@ -171,7 +172,11 @@ func (r *Runner) runStepRequest(step *TStep) (stepData *StepData, err error) {
|
||||
defer resp.Response().Body.Close()
|
||||
|
||||
// new response object
|
||||
respObj := NewResponseObject(r.t, resp)
|
||||
respObj, err := NewResponseObject(r.t, resp)
|
||||
if err != nil {
|
||||
err = errors.Wrap(err, "init ResponseObject error")
|
||||
return
|
||||
}
|
||||
|
||||
// extract variables from response
|
||||
extractors := step.Extract
|
||||
|
||||
Reference in New Issue
Block a user