WebhookBackend constructor
Creates a WebhookBackend.
The url must use the https scheme. Passing an http URL throws
an ArgumentError immediately to prevent accidental plaintext leaks.
Implementation
WebhookBackend({
required this.url,
this.headers = const {},
this.payloadBuilder,
this.timeout = const Duration(seconds: 15),
http.Client? httpClient,
}) : _client = httpClient ?? http.Client() {
if (Uri.parse(url).scheme != 'https') {
throw ArgumentError.value(
url, 'url', 'WebhookBackend requires an HTTPS URL');
}
}