// Teams does not always return non-2xx response when the request fails. Instead, the response body can contain an error message regardless of status code.
// Ex. 429 - Too Many Requests: https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using?tabs=cURL#rate-limiting-for-connectors
// Validation is a function that will validate the response body and statusCode of the webhook. Any returned error will cause the webhook request to be considered failed.
// This can be useful when a webhook service communicates failures in creative ways, such as using the response body instead of the status code.
Validationfunc(body[]byte,statusCodeint)error
}
// WebhookClient exists to mock the client in tests.
typeWebhookClientinterface{
Do(req*http.Request)(*http.Response,error)
}
varnetTransport=&http.Transport{
@ -34,7 +42,7 @@ var netTransport = &http.Transport{