Introduction to Azure SignalR Service REST API

Learn about the Azure SignalR Service REST API.

Overview

The advantage of using REST API to send messages to Azure SignalR Service is that we won’t need to install any additional NuGet packages. We can use any HTTP clients, including the built-in ones. The disadvantage of using REST API is that we will have to write additional code that will convert the objects that are natively used by the hub into a JSON payload of HTTP requests. We will also need to implement our own authentication logic.

Add namespaces

Now, we will go ahead and add some code for sending messages to the hub by using a standard HttpClient class. We will do so inside the HomeController.cs file of the SignalRServer2 project. Before we start, we will need to ensure that we have all of the following namespace references:

Get hands-on with 1200+ tech skills courses.