SignalR .Net Client - Unexpected character encountered while parsing value

后端 未结 4 1400
醉话见心
醉话见心 2021-02-09 12:36

I\'m trying to set up a .Net client to send messages to my signalR hub from my service layer. I\'m following this guide: http://www.asp.net/signalr/overview/signalr-20/hubs-api

4条回答
  •  深忆病人
    2021-02-09 13:32

    When I was getting this message, it was because when pointing to the URL of the server I used HTTP instead of HTTPS:

    using (var hubConnection = new HubConnection("http://someurl.com"))
    {
        var hubProxy = hubConnection.CreateHubProxy("smsHub");
        await hubConnection.Start();
        await hubProxy.Invoke(....);
    }
    

    Pointing to the HTTPS url resolved the issue.

提交回复
热议问题