MCPcopy
hub / github.com/cli/cli / decodeJSONBody

Function decodeJSONBody

pkg/httpmock/stub.go:116–122  ·  view source on GitHub ↗
(req *http.Request, dest interface{})

Source from the content-addressed store, hash-verified

114}
115
116func decodeJSONBody(req *http.Request, dest interface{}) error {
117 b, err := readBody(req)
118 if err != nil {
119 return err
120 }
121 return json.Unmarshal(b, dest)
122}
123
124func StringResponse(body string) Responder {
125 return func(req *http.Request) (*http.Response, error) {

Callers 5

GraphQLFunction · 0.85
GraphQLMutationMatcherFunction · 0.85
RESTPayloadFunction · 0.85
GraphQLMutationFunction · 0.85
GraphQLQueryFunction · 0.85

Calls 1

readBodyFunction · 0.85

Tested by

no test coverage detected