Class AspHttpRequestContext
Provides an ASP.NET Core implementation of IHttpRequestContext for handling HTTP requests.
public class AspHttpRequestContext : IHttpRequestContext
- Inheritance
-
AspHttpRequestContext
- Implements
- Inherited Members
Constructors
AspHttpRequestContext(HttpContext)
Initializes a new instance of the AspHttpRequestContext class.
public AspHttpRequestContext(HttpContext context)
Parameters
contextHttpContextThe ASP.NET Core HttpContext.
Properties
IsWebSocketRequest
Gets a value indicating whether the request is a WebSocket request.
public bool IsWebSocketRequest { get; }
Property Value
Received
Gets or sets the time when the request was received.
public DateTime Received { get; set; }
Property Value
Request
Gets or sets the HTTP request.
public IHttpRequest Request { get; set; }
Property Value
Response
Gets or sets the HTTP response.
public IHttpResponse Response { get; set; }
Property Value
WebSocketRequestedProtocols
Gets the list of WebSocket sub-protocols requested by the client.
public IList<string> WebSocketRequestedProtocols { get; }
Property Value
Methods
AcceptWebSocketAsync(string)
Accepts a WebSocket connection with the specified sub-protocol.
public Task<WebSocket> AcceptWebSocketAsync(string subProtocol)
Parameters
subProtocolstringThe WebSocket sub-protocol to use.
Returns
Release()
Releases the request context and signals completion. Handles redirect if a redirect location is set.
public void Release()
WaitAsync()
Asynchronously waits for the request to be released.
public Task WaitAsync()
Returns
- Task
A task that completes when the request is released.