diff --git a/httpclient/implement/response.go b/httpclient/implement/response.go index 05b4499..c2ed8ef 100644 --- a/httpclient/implement/response.go +++ b/httpclient/implement/response.go @@ -69,10 +69,9 @@ func (r *Response) fillResponseBody(reqCfg *define.Request, response *define.Res if responseContentType == "" { // 返回数据未说明 Content-Type if response.RestyResponse.StatusCode() != http.StatusOK { - responseContentType = "application/json" - } else { - return errors.New("response content type is empty") + return nil } + return errors.New("response content type is empty") } typeArr := strings.Split(strings.Split(responseContentType, ";")[0], "/") responseType := "json"