// MustSendWebhook sends data to the given targetURL.
MustSendWebhook sends data to the given targetURL.
// MustSendWebhook sends data to the given targetURL .
func MustSendWebhook(client *eventingtestlib.Client, targetURL string, data *dockerhub.BuildPayload) {
	jsonData, err := json.Marshal(data)
	if err != nil {
		client.T.Fatalf("failed to marshal payload: %v", err)
	}
	client.T.Logf("Sending %+v to %s", data, targetURL)
	res, err := http.Post(targetURL, "application/json", bytes.NewBuffer(jsonData))
	if err != nil {
		client.T.Fatalf("failed to send payload: %v", err)
	}
	if code := res.StatusCode; code < http.StatusOK || http.StatusBadRequest <= code {
		client.T.Fatalf("status code got: %d", res.StatusCode)
	}
}
func MustSendWebhook ( client * eventingtestlib . Client , targetURL string , data * dockerhub . BuildPayload ) { jsonData , err := json . Marshal ( data ) if err != nil { client . T . Fatalf ( " " , err ) } client . T . Logf ( " " , data , targetURL ) res , err := http . Post ( targetURL , " " , bytes . NewBuffer ( jsonData ) ) if err != nil { client . T . Fatalf ( " " , err ) } if code := res . StatusCode ; code < http . StatusOK || http . StatusBadRequest <= code { client . T . Fatalf ( " " , res . StatusCode ) } }
MustSendWebhook sends data to the given targetURL.
MustSendWebhook sends data to the given targetURL .