Sisk

Class

HttpContext

Namespace
Sisk.Core.Http
Assembly
Sisk.Core.dll

Represents an context that is shared in a entire HTTP session.

C#
public sealed class HttpContext : IDisposable

Inheritance #

object ← HttpContext

Implements #

IDisposable

Inherited Members #

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties #

NameDescription
CurrentGets the current running HttpContext.
ExtraHeadersGets or sets the HttpHeaderCollection indicating HTTP headers which will be added (not overwritten) in the final response.
HttpServerGets the context HttpServer instance.
InterlockedGets the atomic numeric operations available for values stored in RequestBag.
IsRequestContextGets whether the current thread context is running inside an HTTP context.
ListeningHostGets the ListeningHost instance of this HTTP context.
LogModeGets or sets an LogOutput mode for this context, which will overwrite the matched route log mode option.
MatchedRouteGets the matched Route for this context.
OverrideHeadersGets or sets an HttpHeaderCollection indicating HTTP headers which will overwrite headers set by CORS, router response or request handlers.
RequestGets the HttpRequest which is contained in this HTTP context.
RequestBagGets or sets a managed collection for this HTTP context.
RouterGets the Router where this context was created.
RouterResponseGets the HttpResponse for this context. This property acessible when a post-executing IRequestHandler was executed for this router context.

Methods #

NameDescription
EnqueueDeferredAction(Action)Enqueues an action that will be executed after the response is sent to the client. This action runs within the same context, with access to all current context properties before disposal.
EnqueueDeferredAction(Func<Task>)Enqueues an asynchronous action that will be executed after the response is sent to the client. This action runs within the same context, with access to all current context properties before disposal.
EnqueueDeferredAction(Func<CancellationToken, Task>, CancellationToken)Enqueues an asynchronous action that will be executed after the response is sent to the client. This action runs within the same context, with access to all current context properties before disposal.
EnqueueDeferredAction(Func<CancellationToken, Task>, TimeSpan)Enqueues an asynchronous action that will be executed after the response is sent to the client, with a timeout after which the action will be cancelled. This action runs within the same context, with access to all current context properties before disposal.
GetCurrentContext()Gets the current running HttpContext.

Type to search the documentation and the API reference.