MCPcopy
hub / github.com/cli/cli / readBody

Function readBody

pkg/httpmock/stub.go:109–114  ·  view source on GitHub ↗
(req *http.Request)

Source from the content-addressed store, hash-verified

107}
108
109func readBody(req *http.Request) ([]byte, error) {
110 bodyCopy := &bytes.Buffer{}
111 r := io.TeeReader(req.Body, bodyCopy)
112 req.Body = io.NopCloser(bodyCopy)
113 return io.ReadAll(r)
114}
115
116func decodeJSONBody(req *http.Request, dest interface{}) error {
117 b, err := readBody(req)

Callers 1

decodeJSONBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected