update parse content type
This commit is contained in:
parent
0b2546217c
commit
0e6bd9e669
@ -69,10 +69,9 @@ func (r *Response) fillResponseBody(reqCfg *define.Request, response *define.Res
|
|||||||
if responseContentType == "" {
|
if responseContentType == "" {
|
||||||
// 返回数据未说明 Content-Type
|
// 返回数据未说明 Content-Type
|
||||||
if response.RestyResponse.StatusCode() != http.StatusOK {
|
if response.RestyResponse.StatusCode() != http.StatusOK {
|
||||||
responseContentType = "application/json"
|
return nil
|
||||||
} else {
|
|
||||||
return errors.New("response content type is empty")
|
|
||||||
}
|
}
|
||||||
|
return errors.New("response content type is empty")
|
||||||
}
|
}
|
||||||
typeArr := strings.Split(strings.Split(responseContentType, ";")[0], "/")
|
typeArr := strings.Split(strings.Split(responseContentType, ";")[0], "/")
|
||||||
responseType := "json"
|
responseType := "json"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user