MCPcopy Index your code
hub / github.com/mudler/LocalAI / postJSON

Function postJSON

core/http/middleware/request_test.go:35–41  ·  view source on GitHub ↗
(e *echo.Echo, path, body string)

Source from the content-addressed store, hash-verified

33}
34
35func postJSON(e *echo.Echo, path, body string) *httptest.ResponseRecorder {
36 req := httptest.NewRequest(http.MethodPost, path, strings.NewReader(body))
37 req.Header.Set("Content-Type", "application/json")
38 rec := httptest.NewRecorder()
39 e.ServeHTTP(rec, req)
40 return rec
41}
42
43var _ = Describe("SetModelAndConfig middleware", func() {
44 var (

Callers 1

request_test.goFile · 0.70

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected