From a9c82bd2618928026f7f040fd5563b39ee081307 Mon Sep 17 00:00:00 2001 From: pb Date: Wed, 12 Mar 2025 15:37:03 +0100 Subject: [PATCH] Replaced the return of Call[Method]() by the stored value of the resp.Body --- tools/remote_caller.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/remote_caller.go b/tools/remote_caller.go index a8bc4a5..b481bd0 100644 --- a/tools/remote_caller.go +++ b/tools/remote_caller.go @@ -92,11 +92,17 @@ func (caller *HTTPCaller) CallGet(url string, subpath string, types ...string) ( // CallPut calls the DELETE method on the HTTP server func (caller *HTTPCaller) CallDelete(url string, subpath string) ([]byte, error) { - resp, err := http.NewRequest("DELETE", url+subpath, nil) - if err != nil || resp == nil || resp.Body == nil { + req, err := http.NewRequest("DELETE", url+subpath, nil) + if err != nil { + return nil, err + } + client := &http.Client{} + resp, err := client.Do(req) + if err != nil || req == nil || req.Body == nil { return nil, err } defer resp.Body.Close() + err = caller.StoreResp(resp) if err != nil { return nil, err