MCPcopy Create free account
hub / github.com/algolia/cli / JSONResponse

Function JSONResponse

pkg/httpmock/stub.go:40–45  ·  view source on GitHub ↗
(body interface{})

Source from the content-addressed store, hash-verified

38}
39
40func JSONResponse(body interface{}) Responder {
41 return func(req *http.Request) (*http.Response, error) {
42 b, _ := json.Marshal(body)
43 return httpResponse(200, req, bytes.NewBuffer(b)), nil
44 }
45}
46
47func ErrorResponse() Responder {
48 return func(req *http.Request) (*http.Response, error) {

Callers 15

Test_CheckACLsFunction · 0.92
Test_runImportCmdFunction · 0.92
Test_runDeleteCmdFunction · 0.92
Test_runBrowseCmdFunction · 0.92
Test_runUpdateCmdFunction · 0.92
Test_runOperationsCmdFunction · 0.92
Test_runExportCmdFunction · 0.92
Test_runDeleteCmdFunction · 0.92
Test_runSaveCmdFunction · 0.92
Test_runBrowseCmdFunction · 0.92
Test_runExportCmdFunction · 0.92

Calls 1

httpResponseFunction · 0.85

Tested by 15

Test_CheckACLsFunction · 0.74
Test_runImportCmdFunction · 0.74
Test_runDeleteCmdFunction · 0.74
Test_runBrowseCmdFunction · 0.74
Test_runUpdateCmdFunction · 0.74
Test_runOperationsCmdFunction · 0.74
Test_runExportCmdFunction · 0.74
Test_runDeleteCmdFunction · 0.74
Test_runSaveCmdFunction · 0.74
Test_runBrowseCmdFunction · 0.74
Test_runExportCmdFunction · 0.74