diff --git a/modules/http-helper/http_helper.go b/modules/http-helper/http_helper.go index fcf893141..7d9e1361a 100644 --- a/modules/http-helper/http_helper.go +++ b/modules/http-helper/http_helper.go @@ -347,9 +347,13 @@ func HTTPDoWithRetryWithOptionsE( t testing.TestingT, options HttpDoOptions, expectedStatus int, retries int, sleepBetweenRetries time.Duration, ) (string, error) { - // The request body is closed after a request is complete. options. + // The request body is closed after a request is complete. // Extract the underlying data and cache it so we can reuse for retried requests data, err := io.ReadAll(options.Body) + if err != nil { + return "", err + } + options.Body = nil out, err := retry.DoWithRetryE(