Creation of Webhooks for a asp.net core 2.1? Does is support it?
Asked Answered
P

1

6

Is it possible to create custom webhooks in asp.net core 2.1 as a sender? I have seen there is som implemented libraries for receiving webhooks. But I can't find anything for when you want to be the sender.

I only have some basic knowledge about webhooks, maybe I am looking at this wrong? Because I have some trouble finding information when I want to be the sender and not the receiver? Does it have another name than "sender"?.

Thanks.

Profane answered 27/3, 2019 at 12:43 Comment(2)
a webhook is just usually a http resource endpoint. theres the httpclient class that you can use.Greatgranduncle
Why was this question downvoted? It's quite fair for a beginner to ask this question, I guess...Autotrophic
U
12

There's nothing magical about a "webhook". It's just a term for a server calling back to the client (it typically works the other way around, obviously). In short, a webhook is merely some endpoint set up on the "client", which in this case is actually a web server. In ASP.NET Core, that would be just an action on a controller, tied to a particular route, for instance. The "server", the one that's going to be hitting the webhook, is just making an HTTP request to that endpoint.

In short, there's no framework or library for this, because there's nothing to it. If you're the one that needs to hit a webhook, then you'll just make a request via HttpClient to that endpoint. Simple as that.

Unstudied answered 27/3, 2019 at 13:19 Comment(1)
FWIW, there is Microsoft ASP.NET Core WebHooks which provide support for receiving WebHooks with some samples for popular services.Gadfly

© 2022 - 2024 — McMap. All rights reserved.