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

微笑、不失礼 提交于 2020-12-04 08:20:36

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/55377493/creation-of-webhooks-for-a-asp-net-core-2-1-does-is-support-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!