Azure / Azure/azure-functions-dotnet-worker

Sample Code Error: Empty Response in SignalRNegotiationFunctions.cs

Open
#2,929 3 comments 0 reactions 1 assignee Claimed by @Y-Sindo View on GitHub
extensions: signal-r
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

In the following sample code, there seems to be a mistake. When I implemented and ran it, I received an empty response.
https://github.com/Azure/azure-functions-dotnet-worker/blob/main/samples/Extensions/SignalR/SignalRNegotiationFunctions.cs#L12-L20

I modified the sample to the following snippet, and it worked:

```csharp
[Function(nameof(Negotiate))]
public static IActionResult Negotiate([HttpTrigger(AuthorizationLevel.Anonymous)] HttpRequest req,
[SignalRConnectionInfoInput(HubName = "serverless")] string connectionInfo) =>
// The serialization of the connection info object is done by the framework. It should be camel case. The SignalR client respects the camel case response only.
new ContentResult { ContentType = "application/json", Content = connectionInfo };
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.