Http​Request Http​Request Class

Definition

Represents the incoming side of an individual HTTP request.
public abstract class HttpRequestPublic MustInherit Class HttpRequest
Inheritance
System.ObjectSystem.Object
HttpRequestHttpRequest

Inherited Members

System.Object

System.Object.ToString()System.Object.ToString()
System.Object.Equals(System.Object)System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()System.Object.GetHashCode()
System.Object.GetType()System.Object.GetType()
System.Object.MemberwiseClone()System.Object.MemberwiseClone()

Properties

Body Body

Gets or set the RequestBody Stream.
public abstract Stream Body { get; set; }Public MustOverride Property Body As Stream
Value
System.IO.Stream System.IO.Stream
The RequestBody Stream.

ContentLength ContentLength

Gets or sets the Content-Length header
public abstract long ? ContentLength { get; set; }Public MustOverride Property ContentLength As Long?
Value
System.Nullable<System.Int64> System.Nullable(Of System.Int64)

ContentType ContentType

Gets or sets the Content-Type header.
public abstract string ContentType { get; set; }Public MustOverride Property ContentType As String
Value
System.String System.String
The Content-Type header.

Cookies Cookies

Gets the collection of Cookies for this request.
public abstract IRequestCookieCollection Cookies { get; set; }Public MustOverride Property Cookies As IRequestCookieCollection
Value
IRequestCookieCollection IRequestCookieCollection
The collection of Cookies for this request.

Form Form

Gets or sets the request body as a form.
public abstract IFormCollection Form { get; set; }Public MustOverride Property Form As IFormCollection
Value
IFormCollection IFormCollection

HasFormContentType HasFormContentType

Checks the content-type header for form types.
public abstract bool HasFormContentType { get; }Public MustOverride ReadOnly Property HasFormContentType As Boolean
Value
System.Boolean System.Boolean

Headers Headers

Gets the request headers.
public abstract IHeaderDictionary Headers { get; }Public MustOverride ReadOnly Property Headers As IHeaderDictionary
Value
IHeaderDictionary IHeaderDictionary
The request headers.

Host Host

Gets or set the Host header. May include the port.
public abstract HostString Host { get; set; }Public MustOverride Property Host As HostString

HttpContext HttpContext

Gets the HttpContext this request;
public abstract HttpContext HttpContext { get; }Public MustOverride ReadOnly Property HttpContext As HttpContext

IsHttps IsHttps

Returns true if the RequestScheme is https.
public abstract bool IsHttps { get; set; }Public MustOverride Property IsHttps As Boolean
Value
System.Boolean System.Boolean
true if this request is using https; otherwise, false.

Method Method

Gets or set the HTTP method.
public abstract string Method { get; set; }Public MustOverride Property Method As String
Value
System.String System.String
The HTTP method.

Path Path

Gets or set the request path from RequestPath.
public abstract PathString Path { get; set; }Public MustOverride Property Path As PathString
Value
PathString PathString
The request path from RequestPath.

PathBase PathBase

Gets or set the RequestPathBase.
public abstract PathString PathBase { get; set; }Public MustOverride Property PathBase As PathString
Value
PathString PathString
The RequestPathBase.

Protocol Protocol

Gets or set the RequestProtocol.
public abstract string Protocol { get; set; }Public MustOverride Property Protocol As String
Value
System.String System.String
The RequestProtocol.

Query Query

Gets the query value collection parsed from Request.QueryString.
public abstract IQueryCollection Query { get; set; }Public MustOverride Property Query As IQueryCollection
Value
IQueryCollection IQueryCollection
The query value collection parsed from Request.QueryString.

QueryString QueryString

Gets or set the raw query string used to create the query collection in Request.Query.
public abstract QueryString QueryString { get; set; }Public MustOverride Property QueryString As QueryString
Value
QueryString QueryString
The raw query string.

Scheme Scheme

Gets or set the HTTP request scheme.
public abstract string Scheme { get; set; }Public MustOverride Property Scheme As String
Value
System.String System.String
The HTTP request scheme.

Methods

ReadFormAsync(CancellationToken) ReadFormAsync(CancellationToken)

Reads the request body if it is a form.
public abstract Task<IFormCollection> ReadFormAsync(CancellationToken cancellationToken = null)Public MustOverride Function ReadFormAsync(cancellationToken As CancellationToken = Nothing) As Task(Of IFormCollection)
Parameters
cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken
Returns
System.Threading.Tasks.Task<IFormCollection> System.Threading.Tasks.Task(Of IFormCollection)