Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 796

How to read headers data in hub SignalR ASP.NET Core 2.1

$
0
0

I'm trying to pass userId to hub on connection to signalR. This is how client sets up the connection:

         connection = new HubConnectionBuilder()            .WithUrl("http://localhost:56587/hub", options =>            {                options.Headers["UserId"] = loginTextBox.Text;            })            .AddMessagePackProtocol()            .Build();

How can I read this header in OnConnectedAsync() method in my hub?


Viewing all articles
Browse latest Browse all 796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>