diff --git a/httpclient.go b/httpclient.go index bb8a347..10f75c9 100644 --- a/httpclient.go +++ b/httpclient.go @@ -38,12 +38,11 @@ type httpClient struct { // Author : go_developer@163.com<白茶清欢> // // Date : 14:37 2023/2/14 -func (hc *httpClient) Send(requestURL string, method string, header map[string]string, param map[string]interface{}, options httpclient.Map, receiver interface{}) ([]byte, error) { +func (hc *httpClient) Send(requestURL string, method string, header map[string]string, param map[string]interface{}, options httpclient.Map) ([]byte, error) { var ( - err error - response *httpclient.Response - c *httpclient.HttpClient - responseData []byte + err error + response *httpclient.Response + c *httpclient.HttpClient ) if nil == param { param = make(map[string]interface{}) @@ -65,17 +64,7 @@ func (hc *httpClient) Send(requestURL string, method string, header map[string]s return nil, fmt.Errorf("%v : %v", response.StatusCode, response.Status) } - if responseData, err = hc.getResponseBody(response); nil != err { - return nil, err - } - - if nil == receiver { - return responseData, nil - } - if err = json.Unmarshal(responseData, receiver); nil != err { - return responseData, err - } - return responseData, err + return hc.getResponseBody(response) } // getResponseBody ...