You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.8 KiB
1.8 KiB
LINGYUN.Abp.WebhooksManagement.HttpApi.Client
Webhook management HTTP API client module that provides dynamic proxy client for webhook management HTTP API.
Features
- Dynamic API client proxy
- Automatic HTTP client configuration
- Support for remote service calls
- Integration with ABP dynamic C# API client
Module Dependencies
[DependsOn(typeof(AbpWebhooksManagementHttpApiClientModule))]
public class YouProjectModule : AbpModule
{
// other
}
Configuration
{
"RemoteServices": {
"WebhooksManagement": {
"BaseUrl": "http://localhost:44315/" // Base URL for webhook management service
}
}
}
Basic Usage
- Configure Remote Service
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
Configure<AbpRemoteServiceOptions>(options =>
{
options.RemoteServices.Default = new RemoteServiceConfiguration(
configuration["RemoteServices:WebhooksManagement:BaseUrl"]);
});
}
- Use HTTP Client
public class YourService
{
private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService;
public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService)
{
_webhookSubscriptionAppService = webhookSubscriptionAppService;
}
public async Task CallRemoteApi()
{
// Create subscription
await _webhookSubscriptionAppService.CreateAsync(new WebhookSubscriptionCreateDto
{
WebhookUri = "https://your-webhook-endpoint",
Webhooks = new[] { "YourWebhook" }
});
// Query subscriptions
var subscriptions = await _webhookSubscriptionAppService.GetListAsync(
new WebhookSubscriptionGetListInput());
}
}