Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 871
user3690572 Avatar asked Mar 27 '19 12:03

user3690572


People also ask

What is webhook in asp net core?

A webhook is a way for a application to provide callbacks for 3-part applications. When an event occurs, the source application typically triggers an http POST call to a pre-configured external URL and wraps the data from the triggered event in the request's payload.

How do you make a webhook?

To set up a webhook, go to the settings page of your repository or organization. From there, click Webhooks, then Add webhook. Alternatively, you can choose to build and manage a webhook through the Webhooks API. Webhooks require a few configuration options before you can make use of them.

What is a webhook example?

Some real-world examples of webhooks include: Automatically receive an email every morning about your first meeting in case you forget to check your calendar. Have Instagram photos upload automatically to Twitter accounts. Configure the doorbell to flash the lights when it rings.


1 Answers

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.

like image 197
Chris Pratt Avatar answered Sep 28 '22 03:09

Chris Pratt