Transport-neutral webhook contracts for modern .NET applications and libraries.
This package keeps the core webhook handling surface intentionally small:
- request and response value types
- a normalized handler contract
- a result model for accepted, rejected, and ignored webhook processing
It is meant to be reused by platform-specific webhook libraries without forcing an ASP.NET Core dependency or a product-specific architecture.
dotnet add package Agash.Webhook.AbstractionsWebhookRequestfor normalized inbound webhook payloadsWebhookResponsefor transport-neutral HTTP-style responsesWebhookHandleResultfor explicit handler outcomesIWebhookHandlerfor library or host integrations
using Agash.Webhook.Abstractions;
public sealed class SampleWebhookHandler : IWebhookHandler
{
public ValueTask<WebhookHandleResult> HandleAsync(WebhookRequest request, CancellationToken cancellationToken = default)
{
if (request.Body.Length == 0)
{
return ValueTask.FromResult(
WebhookHandleResult.Rejected(
WebhookResponse.BadRequest("Request body is required.")));
}
return ValueTask.FromResult(WebhookHandleResult.Accepted());
}
}- no web framework dependency
- explicit request and response modeling
- easy to compose into ASP.NET Core, worker services, desktop apps, or test hosts
- suitable as a base abstraction for higher-level webhook client libraries
dotnet test Agash.Webhook.Abstractions.slnx