// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Security.Claims; using System.Threading; using Microsoft.AspNet.Http.Authentication; using Microsoft.AspNet.Http.Features; namespace Microsoft.AspNet.Http { /// /// Encapsulates all HTTP-specific information about an individual HTTP request. /// public abstract class HttpContext { /// /// Gets the collection of HTTP features provided by the server and middleware available on this request. /// public abstract IFeatureCollection Features { get; } /// /// Gets the object for this request. /// public abstract HttpRequest Request { get; } /// /// Gets the object for this request. /// public abstract HttpResponse Response { get; } /// /// Gets information about the underlying connection for this request. /// public abstract ConnectionInfo Connection { get; } /// /// Gets an object that manages the establishment of WebSocket connections for this request. /// public abstract WebSocketManager WebSockets { get; } /// /// Gets an object that facilitates authentication for this request. /// public abstract AuthenticationManager Authentication { get; } /// /// Gets or sets the the user for this request. /// public abstract ClaimsPrincipal User { get; set; } /// /// Gets or sets a key/value collection that can be used to share data within the scope of this request. /// public abstract IDictionary Items { get; set; } /// /// Gets or sets the that provides access to the application's service container. /// public abstract IServiceProvider ApplicationServices { get; set; } /// /// Gets or sets the that provides access to the request's service container. /// public abstract IServiceProvider RequestServices { get; set; } /// /// Notifies when the connection underlying this request is aborted and thus request operations should be /// cancelled. /// public abstract CancellationToken RequestAborted { get; set; } /// /// Gets or sets a unique identifier to represent this request in trace logs. /// public abstract string TraceIdentifier { get; set; } /// /// Gets or sets the object used to manage user session data for this request. /// public abstract ISession Session { get; set; } /// /// Aborts the connection underlying this request. /// public abstract void Abort(); } }