Webhook Serialization
The most common format for the payloads of Webhooks is the JSON format, but it is possible to use also the XML format, as long as the receiver is able to understand it. The framework provides a mechanism to serialize the payloads of the messages sent to the receivers.
The framework provides a set of default implementation of the serializers
Type | Library | Description |
---|---|---|
SystemTextWebhookJsonSerializer | Deveel.Webhooks | An implementation that uses the System.Text.Json serialization functions (recommended) |
NewtonsoftWebhookJsonSerializer | Deveel.Webhooks.NewtonsoftJson | Implements the webhook serialization by using the Newtonsoft.Json serializers |
SystemWebhookXmlSerializer | Deveel.Webhooks | Serializes webhooks to XML using the System.Xml native functions |
When initializing the sender, a default serializer for each format is added to the service, but it is possible to add custom ones through the call to .UseJsonSerializer<TSerializer>()
or .UseXmlSerializer<TSerializer>()
of the service builder.
Last updated