MCPcopy
hub / github.com/larksuite/cli / jsonResponse

Function jsonResponse

internal/client/client_test.go:35–42  ·  view source on GitHub ↗

jsonResponse creates an HTTP response with JSON body.

(body interface{})

Source from the content-addressed store, hash-verified

33
34// jsonResponse creates an HTTP response with JSON body.
35func jsonResponse(body interface{}) *http.Response {
36 b, _ := json.Marshal(body)
37 return &http.Response{
38 StatusCode: 200,
39 Header: http.Header{"Content-Type": []string{"application/json"}},
40 Body: io.NopCloser(bytes.NewReader(b)),
41 }
42}
43
44// staticTokenResolver always returns a fixed token without any HTTP calls.
45type staticTokenResolver struct{}

Calls

no outgoing calls

Tested by

no test coverage detected