in client/start.go [55:68]
func sendHTTP(url string, data []byte) ([]byte, error) {
resp, err := http.Post(url, "application/json", bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("failed to send HTTP request: %v", err)
}
body, err := ioutil.ReadAll(resp.Body)
if resp.StatusCode < 200 || resp.StatusCode > 299 {
if err != nil {
return nil, fmt.Errorf("reading HTTP response body: %v", err)
}
return nil, fmt.Errorf("validation failed with exit code %d: %v", resp.StatusCode, string(body))
}
return body, nil
}