[英]How do i broadcast a message to all clients via Web API
I have two Projects, an Asp.net WebAPI & a separate Single Page Web Application. 我有两个项目,一个Asp.net WebAPI和一个单独的单页Web应用程序。 My requirement is that when a form is submitted via the web application it is processed at the Web API.
我的要求是,当通过Web应用程序提交表单时,将在Web API上对其进行处理。 Once the Request has been handled successfully i want to broadcast a message to all the clients notifying them that a new request had been submitted.
一旦成功处理了请求,我想向所有客户端广播一条消息,通知他们新的请求已提交。 How can I do it?
我该怎么做? Any help would be appreciated.
任何帮助,将不胜感激。 I looked into SignalR, but couldn't find an implementation for this requirement.
我调查了SignalR,但找不到此要求的实现。
Pusher的库可用于处理任何通知https://pusher.com/docs/libraries
I suggest you use signalR to cater your requirement. 我建议您使用signalR来满足您的要求。 You can go thru this link https://docs.microsoft.com/en-us/aspnet/signalr/overview/getting-started/ for more details.
您可以通过此链接https://docs.microsoft.com/zh-cn/aspnet/signalr/overview/getting-started/了解更多详细信息。
If your project is small use pusher " https://pusher.com/ " 如果您的项目很小,则使用推送器“ https://pusher.com/ ”
when you use that well It may be cheaper than you make And less resources. 当您很好地使用它时,它可能会比您制造的便宜并且资源更少。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.