Created
September 16, 2022 13:55
-
-
Save vidhill/8b9280451bf49abf828a513217db9084 to your computer and use it in GitHub Desktop.
Make copy of response body reader, and dump json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"net/http" | |
"os" | |
"strings" | |
) | |
func dummmy(){ | |
response := &http.Response{ | |
Body: io.NopCloser(strings.NewReader(`{"foo": "bar"}`)), | |
} | |
responseBodyCopy := io.TeeReader(response.Body, os.Stdout) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment