diff --git a/src/Microsoft.AspNetCore.Http.Features/IHttpRequestFeature.cs b/src/Microsoft.AspNetCore.Http.Features/IHttpRequestFeature.cs
index 4b52060177..16511caa74 100644
--- a/src/Microsoft.AspNetCore.Http.Features/IHttpRequestFeature.cs
+++ b/src/Microsoft.AspNetCore.Http.Features/IHttpRequestFeature.cs
@@ -5,15 +5,62 @@ using System.IO;
namespace Microsoft.AspNetCore.Http.Features
{
+ ///
+ /// Contains the details of a given request. These properties should all be mutable.
+ /// None of these properties should ever be set to null.
+ ///
public interface IHttpRequestFeature
{
+ ///
+ /// The HTTP-version as defined in RFC 7230. E.g. "HTTP/1.1"
+ ///
string Protocol { get; set; }
+
+ ///
+ /// The request uri scheme. E.g. "http" or "https". Note this value is not included
+ /// in the original request, it is inferred by checking if the transport used a TLS
+ /// connection or not.
+ ///
string Scheme { get; set; }
+
+ ///
+ /// The request method as defined in RFC 7230. E.g. "GET", "HEAD", "POST", etc..
+ ///
string Method { get; set; }
+
+ ///
+ /// The first portion of the request path associated with application root. The value
+ /// is un-escaped. The value may be string.Empty.
+ ///
string PathBase { get; set; }
+
+ ///
+ /// The portion of the request path that identifies the requested resource. The value
+ /// is un-escaped. The value may be string.Empty if contains the
+ /// full path.
+ ///
string Path { get; set; }
+
+ ///
+ /// The query portion of the request-target as defined in RFC 7230. The value
+ /// may be string.Empty. If not empty then the leading '?' will be included. The value
+ /// is in its original form, without un-escaping.
+ ///
string QueryString { get; set; }
+
+ ///
+ /// Headers included in the request, aggregated by header name. The values are not split
+ /// or merged across header lines. E.g. The following headers:
+ /// HeaderA: value1, value2
+ /// HeaderA: value3
+ /// Result in Headers["HeaderA"] = { "value1, value2", "value3" }
+ ///
IHeaderDictionary Headers { get; set; }
+
+ ///
+ /// A representing the request body, if any. Stream.Null may be used
+ /// to represent an empty request body.
+ ///
Stream Body { get; set; }
}
}
diff --git a/src/Microsoft.AspNetCore.Http.Features/IHttpRequestLifetimeFeature.cs b/src/Microsoft.AspNetCore.Http.Features/IHttpRequestLifetimeFeature.cs
index 3a93c3d1e5..1bdac15766 100644
--- a/src/Microsoft.AspNetCore.Http.Features/IHttpRequestLifetimeFeature.cs
+++ b/src/Microsoft.AspNetCore.Http.Features/IHttpRequestLifetimeFeature.cs
@@ -7,7 +7,17 @@ namespace Microsoft.AspNetCore.Http.Features
{
public interface IHttpRequestLifetimeFeature
{
+ ///
+ /// A that fires if the request is aborted and
+ /// the application should cease processing. The token will not fire if the request
+ /// completes successfully.
+ ///
CancellationToken RequestAborted { get; set; }
+
+ ///
+ /// Forcefully aborts the request if it has not already completed. This will result in
+ /// RequestAborted being triggered.
+ ///
void Abort();
}
}
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Http.Features/IHttpResponseFeature.cs b/src/Microsoft.AspNetCore.Http.Features/IHttpResponseFeature.cs
index 8ea43d61fd..9d3b957efb 100644
--- a/src/Microsoft.AspNetCore.Http.Features/IHttpResponseFeature.cs
+++ b/src/Microsoft.AspNetCore.Http.Features/IHttpResponseFeature.cs
@@ -7,14 +7,53 @@ using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Http.Features
{
+ ///
+ /// Represents the fields and state of an HTTP response.
+ ///
public interface IHttpResponseFeature
{
+ ///
+ /// The status-code as defined in RFC 7230. The default value is 200.
+ ///
int StatusCode { get; set; }
+
+ ///
+ /// The reason-phrase as defined in RFC 7230. Note this field is no longer supported by HTTP/2.
+ ///
string ReasonPhrase { get; set; }
+
+ ///
+ /// The response headers to send. Headers with multiple values will be emitted as multiple headers.
+ ///
IHeaderDictionary Headers { get; set; }
+
+ ///
+ /// The for writing the response body.
+ ///
Stream Body { get; set; }
+
+ ///
+ /// Indicates if the response has started. If true, the ,
+ /// , and are now immutable, and
+ /// OnStarting should no longer be called.
+ ///
bool HasStarted { get; }
+
+ ///
+ /// Registers a callback to be invoked just before the response starts. This is the
+ /// last chance to modify the , , or
+ /// .
+ ///
+ /// The callback to invoke when starting the response.
+ /// The state to pass into the callback.
void OnStarting(Func