MCPcopy Create free account
hub / github.com/cloudflare/cfssl / post

Function post

api/api_test.go:45–60  ·  view source on GitHub ↗
(t *testing.T, obj map[string]interface{}, ts *httptest.Server)

Source from the content-addressed store, hash-verified

43}
44
45func post(t *testing.T, obj map[string]interface{}, ts *httptest.Server) (resp *http.Response, body []byte) {
46 blob, err := json.Marshal(obj)
47 if err != nil {
48 t.Fatal(err)
49 }
50
51 resp, err = http.Post(ts.URL, "application/json", bytes.NewReader(blob))
52 if err != nil {
53 t.Fatal(err)
54 }
55 body, err = io.ReadAll(resp.Body)
56 if err != nil {
57 t.Fatal(err)
58 }
59 return
60}
61
62func get(t *testing.T, ts *httptest.Server) (resp *http.Response, body []byte) {
63 resp, err := http.Get(ts.URL)

Callers 2

TestRigidHandleFunction · 0.85
TestCleverHandleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…