This repository has been archived by the owner on Nov 20, 2018. It is now read-only.
/
HttpContext.cs
84 lines (70 loc) · 3.05 KB
/
HttpContext.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// 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.AspNetCore.Http.Authentication;
using Microsoft.AspNetCore.Http.Features;
namespace Microsoft.AspNetCore.Http
{
/// <summary>
/// Encapsulates all HTTP-specific information about an individual HTTP request.
/// </summary>
public abstract class HttpContext
{
/// <summary>
/// Gets the collection of HTTP features provided by the server and middleware available on this request.
/// </summary>
public abstract IFeatureCollection Features { get; }
/// <summary>
/// Gets the <see cref="HttpRequest"/> object for this request.
/// </summary>
public abstract HttpRequest Request { get; }
/// <summary>
/// Gets the <see cref="HttpResponse"/> object for this request.
/// </summary>
public abstract HttpResponse Response { get; }
/// <summary>
/// Gets information about the underlying connection for this request.
/// </summary>
public abstract ConnectionInfo Connection { get; }
/// <summary>
/// Gets an object that manages the establishment of WebSocket connections for this request.
/// </summary>
public abstract WebSocketManager WebSockets { get; }
/// <summary>
/// Gets an object that facilitates authentication for this request.
/// </summary>
public abstract AuthenticationManager Authentication { get; }
/// <summary>
/// Gets or sets the the user for this request.
/// </summary>
public abstract ClaimsPrincipal User { get; set; }
/// <summary>
/// Gets or sets a key/value collection that can be used to share data within the scope of this request.
/// </summary>
public abstract IDictionary<object, object> Items { get; set; }
/// <summary>
/// Gets or sets the <see cref="IServiceProvider"/> that provides access to the request's service container.
/// </summary>
public abstract IServiceProvider RequestServices { get; set; }
/// <summary>
/// Notifies when the connection underlying this request is aborted and thus request operations should be
/// cancelled.
/// </summary>
public abstract CancellationToken RequestAborted { get; set; }
/// <summary>
/// Gets or sets a unique identifier to represent this request in trace logs.
/// </summary>
public abstract string TraceIdentifier { get; set; }
/// <summary>
/// Gets or sets the object used to manage user session data for this request.
/// </summary>
public abstract ISession Session { get; set; }
/// <summary>
/// Aborts the connection underlying this request.
/// </summary>
public abstract void Abort();
}
}