Skip to content

Commit

Permalink
forgot
Browse files Browse the repository at this point in the history
  • Loading branch information
brianluong committed Dec 19, 2023
1 parent 04e95aa commit 6ecb206
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/util/http.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package util

import (
"bytes"
"io"
"net/http"
)

func ReadAndCopyBackResponseBody(resp *http.Response) string {
respBody, _ := io.ReadAll(resp.Body)
respBodyString := string(respBody)

resp.Body.Close()

resp.Body = io.NopCloser(bytes.NewBuffer(respBody))

return respBodyString
}

0 comments on commit 6ecb206

Please sign in to comment.