Table of Contents

Interface IHttpRequestContext

Namespace
VAST.HTTP
Assembly
VAST.Common.dll

Defines the contract for an HTTP request context containing request, response, and WebSocket support.

public interface IHttpRequestContext

Properties

IsWebSocketRequest

Gets a value indicating whether this is a WebSocket upgrade request.

bool IsWebSocketRequest { get; }

Property Value

bool

Received

Gets or sets the timestamp when the request was received.

DateTime Received { get; set; }

Property Value

DateTime

Request

Gets or sets the HTTP request.

IHttpRequest Request { get; set; }

Property Value

IHttpRequest

Response

Gets or sets the HTTP response.

IHttpResponse Response { get; set; }

Property Value

IHttpResponse

WebSocketRequestedProtocols

Gets the list of WebSocket sub-protocols requested by the client.

IList<string> WebSocketRequestedProtocols { get; }

Property Value

IList<string>

Methods

AcceptWebSocketAsync(string)

Accepts a WebSocket connection with the specified sub-protocol.

Task<WebSocket> AcceptWebSocketAsync(string subProtocol)

Parameters

subProtocol string

The WebSocket sub-protocol to use, or null for no sub-protocol.

Returns

Task<WebSocket>

A task that returns the accepted WebSocket.

Release()

Releases the request context and completes the response.

void Release()

WaitAsync()

Waits asynchronously for the request processing to complete.

Task WaitAsync()

Returns

Task

A task representing the asynchronous wait operation.