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

Function ErrorResponseWithBody

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

Source from the content-addressed store, hash-verified

51}
52
53func ErrorResponseWithBody(body interface{}) Responder {
54 return func(req *http.Request) (*http.Response, error) {
55 b, _ := json.Marshal(body)
56 return httpResponse(400, req, bytes.NewBuffer(b)), nil
57 }
58}
59
60func httpResponse(status int, req *http.Request, body io.Reader) *http.Response {
61 return &http.Response{

Callers 1

Test_runCrawlCmdFunction · 0.92

Calls 1

httpResponseFunction · 0.85

Tested by 1

Test_runCrawlCmdFunction · 0.74