HttpContext HttpContext HttpContext Class

Definition

Encapsulates all HTTP-specific information about an individual HTTP request.

public abstract class HttpContext
type HttpContext = class
Public MustInherit Class HttpContext
Inheritance
HttpContextHttpContextHttpContext
Derived

Constructors

HttpContext() HttpContext() HttpContext()

Properties

Authentication Authentication Authentication

This is obsolete and will be removed in a future version. The recommended alternative is to use Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions. See https://go.microsoft.com/fwlink/?linkid=845470.

Connection Connection Connection

Gets information about the underlying connection for this request.

Features Features Features

Gets the collection of HTTP features provided by the server and middleware available on this request.

Items Items Items

Gets or sets a key/value collection that can be used to share data within the scope of this request.

Request Request Request

Gets the HttpRequest object for this request.

RequestAborted RequestAborted RequestAborted

Notifies when the connection underlying this request is aborted and thus request operations should be cancelled.

RequestServices RequestServices RequestServices

Gets or sets the IServiceProvider that provides access to the request's service container.

Response Response Response

Gets the HttpResponse object for this request.

Session Session Session

Gets or sets the object used to manage user session data for this request.

TraceIdentifier TraceIdentifier TraceIdentifier

Gets or sets a unique identifier to represent this request in trace logs.

User User User

Gets or sets the user for this request.

WebSockets WebSockets WebSockets

Gets an object that manages the establishment of WebSocket connections for this request.

Methods

Abort() Abort() Abort()

Aborts the connection underlying this request.

Extension Methods

AuthenticateAsync(HttpContext) AuthenticateAsync(HttpContext) AuthenticateAsync(HttpContext)

Extension method for authenticate using the DefaultAuthenticateScheme scheme.

AuthenticateAsync(HttpContext, String) AuthenticateAsync(HttpContext, String) AuthenticateAsync(HttpContext, String)

Extension method for authenticate.

ChallengeAsync(HttpContext) ChallengeAsync(HttpContext) ChallengeAsync(HttpContext)

Extension method for authenticate using the DefaultChallengeScheme scheme.

ChallengeAsync(HttpContext, AuthenticationProperties) ChallengeAsync(HttpContext, AuthenticationProperties) ChallengeAsync(HttpContext, AuthenticationProperties)

Extension method for authenticate using the DefaultChallengeScheme scheme.

ChallengeAsync(HttpContext, String) ChallengeAsync(HttpContext, String) ChallengeAsync(HttpContext, String)

Extension method for Challenge.

ChallengeAsync(HttpContext, String, AuthenticationProperties) ChallengeAsync(HttpContext, String, AuthenticationProperties) ChallengeAsync(HttpContext, String, AuthenticationProperties)

Extension method for Challenge.

ForbidAsync(HttpContext) ForbidAsync(HttpContext) ForbidAsync(HttpContext)

Extension method for Forbid using the DefaultForbidScheme scheme..

ForbidAsync(HttpContext, AuthenticationProperties) ForbidAsync(HttpContext, AuthenticationProperties) ForbidAsync(HttpContext, AuthenticationProperties)

Extension method for Forbid.

ForbidAsync(HttpContext, String) ForbidAsync(HttpContext, String) ForbidAsync(HttpContext, String)

Extension method for Forbid.

ForbidAsync(HttpContext, String, AuthenticationProperties) ForbidAsync(HttpContext, String, AuthenticationProperties) ForbidAsync(HttpContext, String, AuthenticationProperties)

Extension method for Forbid.

GetTokenAsync(HttpContext, String) GetTokenAsync(HttpContext, String) GetTokenAsync(HttpContext, String)

Extension method for getting the value of an authentication token.

GetTokenAsync(HttpContext, String, String) GetTokenAsync(HttpContext, String, String) GetTokenAsync(HttpContext, String, String)

Extension method for getting the value of an authentication token.

SignInAsync(HttpContext, ClaimsPrincipal) SignInAsync(HttpContext, ClaimsPrincipal) SignInAsync(HttpContext, ClaimsPrincipal)

Extension method for SignIn using the DefaultSignInScheme.

SignInAsync(HttpContext, ClaimsPrincipal, AuthenticationProperties) SignInAsync(HttpContext, ClaimsPrincipal, AuthenticationProperties) SignInAsync(HttpContext, ClaimsPrincipal, AuthenticationProperties)

Extension method for SignIn using the DefaultSignInScheme.

SignInAsync(HttpContext, String, ClaimsPrincipal) SignInAsync(HttpContext, String, ClaimsPrincipal) SignInAsync(HttpContext, String, ClaimsPrincipal)

Extension method for SignIn.

SignInAsync(HttpContext, String, ClaimsPrincipal, AuthenticationProperties) SignInAsync(HttpContext, String, ClaimsPrincipal, AuthenticationProperties) SignInAsync(HttpContext, String, ClaimsPrincipal, AuthenticationProperties)

Extension method for SignIn.

SignOutAsync(HttpContext) SignOutAsync(HttpContext) SignOutAsync(HttpContext)

Extension method for SignOut using the DefaultSignOutScheme.

SignOutAsync(HttpContext, AuthenticationProperties) SignOutAsync(HttpContext, AuthenticationProperties) SignOutAsync(HttpContext, AuthenticationProperties)

Extension method for SignOut using the DefaultSignOutScheme.

SignOutAsync(HttpContext, String) SignOutAsync(HttpContext, String) SignOutAsync(HttpContext, String)

Extension method for SignOut.

SignOutAsync(HttpContext, String, AuthenticationProperties) SignOutAsync(HttpContext, String, AuthenticationProperties) SignOutAsync(HttpContext, String, AuthenticationProperties)

Extension method for SignOut.

GetHttpRequestMessage(HttpContext) GetHttpRequestMessage(HttpContext) GetHttpRequestMessage(HttpContext)
GetRouteData(HttpContext) GetRouteData(HttpContext) GetRouteData(HttpContext)

Gets the RouteData associated with the provided httpContext.

GetRouteValue(HttpContext, String) GetRouteValue(HttpContext, String) GetRouteValue(HttpContext, String)

Gets a route value from Values associated with the provided httpContext.

Applies to