SignalR Core给ConnectionId所需的错误

时间:2017-12-23 19:30:32

标签: asp.net-core signalr asp.net-core-2.0 asp.net-core-signalr

我试图在我的ASP.NET Core 2.0应用程序中实现SignalR - 使用SignalR Core Alpha。

enter image description here

当我使用Postman向Hub发送简单文本时,我收到HttpStatus 400并显示ConnectionId Required错误消息。在Postman中,我尝试了两种GETPOST方法并得到了相同的结果。

enter image description here

enter image description here

我有一个接收字符串的非常简单的方法 - 见下文:

public Task Send(string message)
{
   return Clients.All.InvokeAsync("Send", message);
}

知道这里有什么问题吗?

1 个答案:

答案 0 :(得分:1)

在Twitter上得到了自己@DavidFowl的回复,我必须通过SignalR客户端发送我的消息,以便集线器接受它们。 SignalR hub不接受来自常规Web客户端的消息。 https://twitter.com/SamUresin/status/944652532990738433