为 ASP.NET Core 2.1 创建 Webhooks?是否支持? [英] Creation of Webhooks for a asp.net core 2.1? Does is support it?

查看:25
本文介绍了为 ASP.NET Core 2.1 创建 Webhooks?是否支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 asp.net core 2.1 中创建自定义 webhook 作为发送者?我看到有一些用于接收 webhooks 的实现库.但是当你想成为发件人时,我找不到任何东西.

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.

我只有一些关于 webhooks 的基本知识,也许我看错了?因为当我想成为发送者而不是接收者时,我在查找信息时遇到了一些麻烦?除了发件人"之外,它还有其他名称吗?

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"?.

谢谢.

推荐答案

网络钩子"并没有什么神奇之处.这只是服务器回调客户端的一个术语(显然,它通常以相反的方式工作).简而言之,webhook 只是在客户端"上设置的某个端点,在这种情况下,它实际上是一个 Web 服务器.例如,在 ASP.NET Core 中,这只是控制器上的一个操作,绑定到特定的路由.服务器",即将要访问 Webhook 的那个,只是向该端点发出 HTTP 请求.

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.

简而言之,这里没有框架或库,因为它什么都没有.如果您是需要访问 webhook 的人,那么您只需通过 HttpClient 向该端点发出请求.就这么简单.

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.

这篇关于为 ASP.NET Core 2.1 创建 Webhooks?是否支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆