MCPcopy
hub / github.com/mudler/LocalAI / postJSON

Function postJSON

tests/e2e/e2e_pii_ner_test.go:176–186  ·  view source on GitHub ↗
(path string, payload any)

Source from the content-addressed store, hash-verified

174}
175
176func postJSON(path string, payload any) (int, []byte) {
177 GinkgoHelper()
178 data, err := json.Marshal(payload)
179 Expect(err).NotTo(HaveOccurred())
180 httpResp, err := http.Post(anthropicBaseURL+path, "application/json", bytes.NewReader(data))
181 Expect(err).NotTo(HaveOccurred())
182 defer func() { _ = httpResp.Body.Close() }()
183 body, err := io.ReadAll(httpResp.Body)
184 Expect(err).NotTo(HaveOccurred())
185 return httpResp.StatusCode, body
186}

Callers 2

analyzeFunction · 0.70
redactFunction · 0.70

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected