Skip to content

Commit 4e41ea8

Browse files
committed
Updates
1 parent f3ea400 commit 4e41ea8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aspnetcore/signalr/httpcontext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ Even when an <xref:Microsoft.AspNetCore.Http.HttpContext> instance is available,
2020
* Long polling receives a new context per client "poll" request.
2121
* A SignalR service receives a mocked/faked/shim context.
2222

23-
When in the hub, <xref:Microsoft.AspNetCore.SignalR.GetHttpContextExtensions.GetHttpContext%2A?displayProperty=nameWithType> returns a subset of <xref:Microsoft.AspNetCore.Http.HttpContext> properties from the mocked/faked/shim SignalR HTTP layer for the connection or `null` if the connection isn't associated with an HTTP request. Use this method to get HTTP connection information, such as HTTP headers and query strings. For more information, see <xref:signalr/hubs#the-context-object>.
23+
When working within a SignalR hub, you can access the <xref:Microsoft.AspNetCore.Http.HttpContext> directly using the <xref:Microsoft.AspNetCore.SignalR.GetHttpContextExtensions.GetHttpContext%2A?displayProperty=nameWithType> method. This method returns the <xref:Microsoft.AspNetCore.Http.HttpContext> for the current connection or `null` if the connection isn't associated with an HTTP request. This is particularly useful for retrieving HTTP connection information, such as headers and query strings, directly within the hub. We recommend calling this method over <xref:Microsoft.AspNetCore.Http.IHttpContextAccessor> for accessing <xref:Microsoft.AspNetCore.Http.HttpContext> in the hub. For more information, see <xref:signalr/hubs#the-context-object>.
2424

2525
For guidance on <xref:Microsoft.AspNetCore.Http.IHttpContextAccessor>/<xref:Microsoft.AspNetCore.Http.HttpContext> in ASP.NET Core Blazor apps, see <xref:blazor/components/httpcontext>.

0 commit comments

Comments
 (0)