Function
httpPost
(url string, contentType string, body io.Reader)
Source from the content-addressed store, hash-verified
| 120 | } |
| 121 | |
| 122 | func 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 | } |
Tested by
no test coverage detected