diff --git a/tools/remote_caller.go b/tools/remote_caller.go index 02d440f..afabac7 100644 --- a/tools/remote_caller.go +++ b/tools/remote_caller.go @@ -113,7 +113,10 @@ func (caller *HTTPCaller) CallPost(url string, subpath string, body interface{}, return nil, err } defer resp.Body.Close() - caller.LastResults = resp + err = caller.StoreResp(resp) + if err != nil { + return nil, err + } return io.ReadAll(resp.Body) } @@ -132,7 +135,6 @@ func (caller *HTTPCaller) CallPut(url string, subpath string, body map[string]in return nil, err } defer resp.Body.Close() - caller.LastResults = resp return io.ReadAll(resp.Body) } @@ -158,7 +160,6 @@ func (caller *HTTPCaller) CallRaw(method string, url string, subpath string, return nil, err } - caller.LastResults = resp return resp, nil } @@ -190,6 +191,6 @@ func (caller *HTTPCaller) StoreResp(resp *http.Response) error { } caller.LastResults["body"] = data - + return nil } \ No newline at end of file