MCPcopy
hub / github.com/Terry-Mao/goim / httpPost

Function httpPost

benchmarks/push/main.go:122–135  ·  view source on GitHub ↗
(url string, contentType string, body io.Reader)

Source from the content-addressed store, hash-verified

120}
121
122func httpPost(url string, contentType string, body io.Reader) (*http.Response, error) {
123 req, err := http.NewRequest("POST", url, body)
124 if err != nil {
125 return nil, err
126 }
127
128 req.Header.Set("Content-Type", contentType)
129 resp, err := httpClient.Do(req)
130 if err != nil {
131 return nil, err
132 }
133
134 return resp, nil
135}

Callers 1

startPushFunction · 0.70

Calls 1

SetMethod · 0.45

Tested by

no test coverage detected