Configuring the Sender
Configuring the Delivery Behavior
The WebhookSenderOptions
var options = new WebhookSenderOptions {
// When using the IHttpClientFactory, this is the name of the client
// that will be used to send the webhooks
HttpClientName = "my-http-client",
// A set of default headers that will be added to the requests
// sent to the webhook recipients
DefaultHeaders = new Dictionary<string, string> {
// The default headers that will be added to the requests
// sent to the webhook recipients
["X-Sender"] = "My-Webhook-Sender/1.0"
},
// The default format of the payload that will be sent to the
// webhook recipients (possible values are Json and Xml)
DefaultFormat = WebhookPayloadFormat.Json,
// The default timeout for the requests sent to the webhook
// recipients to be completed, before being considered failed
Timeout = TimeSpan.FromSeconds(30),
// The default retry options for the requests sent to the webhook
// recipients, that can be overridden by the specific subscription
// configurations
Retry = new WebhookRetryOptions {
// The default number of retries that will be performed
// after a failed request, before giving up
MaxRetries = 3,
// The default delay between retries
Delay = TimeSpan.FromSeconds(5),
// The default timeout for each retry request
// before being considered failed
Timeout = TimeSpan.FromSeconds(3)
},
// The default signature options for the requests sent to the webhook
// recipients, that can be overridden by the specific subscription
// configurations
Singature = new WebhookSenderSignatureOptions {
// The default location within the request where the signature
// will be added (possible values are Header and QueryString)
Location = WebhookSignatureLocation.Header,
// The default name of the header that carries the signature,
// when the location of the signature is the Header
HeaderName = "X-Signature",
// The default name of the query string parameter that carries
// the signature, when the location of the signature is the QueryString
QueryParameter = "signature",
// The default algorithm that will be used to sign the requests
// sent to the webhook recipients
Algorithm = WebhookSignatureAlgorithm.HmacSha256,
// The name of the query string parameter that will be used to
// specify the algorithm used for the signature
AlgorithmQueryParameter = "alg_sig"
}
};
IConfiguration Pattern
Manual Configuration
Last updated