(httpClient *http.Client, hostname string, u safeurl.SafeURL, payload map[string]string)
| 104 | } |
| 105 | |
| 106 | func keyUpload(httpClient *http.Client, hostname string, u safeurl.SafeURL, payload map[string]string) error { |
| 107 | payloadBytes, err := json.Marshal(payload) |
| 108 | if err != nil { |
| 109 | return err |
| 110 | } |
| 111 | |
| 112 | // TODO(api-client-rollout) |
| 113 | // This line of code is part of a mechanical roll out of the api client. |
| 114 | // As a follow up, consider whether the api client can be injected to this call site, rather than constructed |
| 115 | return api.NewClientFromHTTP(httpClient).REST(hostname, http.MethodPost, u.String(), bytes.NewBuffer(payloadBytes), nil) |
| 116 | } |
no test coverage detected