简体   繁体   English

如何通过Web API向所有客户端广播消息

[英]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.

相关问题 WCF双工回调,如何向所有客户端发送消息? - WCF duplex callbacks, how do I send a message to all clients? 如何通过使用WCF NetHttpBinding(WebSockets)的服务器将一个客户端发送的消息广播(推送)到所有客户端? - How to broadcast (push) a message send by one client, to all clients through a server using WCF NetHttpBinding (WebSockets)? 向所有连接的客户端发送广播 POP-UP 消息 - Send a broadcast POP-UP Message to All the Connected Clients 如何在服务器广播中使用 signalr 仅对单个客户端,而不是所有客户端? - How can I use signalr in server broadcast to a single client only, not all clients? 如何让服务器响应所有客户端? - How do I make the server respond to all clients? Web API-如何在未经授权的请求中删除响应消息中的WWW-Authenticate标头 - Web API - How do I remove WWW-Authenticate header in response message with unauthorized request 如何在ASP.NET Web API中配置缓冲区大小和最大消息大小 - How do I configure the buffer size and max message size in the ASP.NET Web API 如何在传递到控制器C#Web API的模型上创建自定义验证消息 - How do I create a custom validation message on a model passed into a controller c# web api 如何添加/更改.NET Web API的默认Json消息响应属性? - How do I add/change .NET Web API's default Json message response properties? 如何通过Web Api创建TFS 2013 Git存储库? - How do I create a TFS 2013 Git repository via Web Api?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM