HttpRequest Class

Definition

Represents the incoming side of an individual HTTP request.

public abstract class HttpRequest
Inheritance
HttpRequest
Derived
Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest

Constructors

HttpRequest()

Properties

Body

Gets or set the RequestBody Stream.

ContentLength

Gets or sets the Content-Length header

ContentType

Gets or sets the Content-Type header.

Cookies

Gets the collection of Cookies for this request.

Form

Gets or sets the request body as a form.

HasFormContentType

Checks the content-type header for form types.

Headers

Gets the request headers.

Host

Gets or set the Host header. May include the port.

HttpContext

Gets the HttpContext for this request.

IsHttps

Returns true if the RequestScheme is https.

Method

Gets or set the HTTP method.

Path

Gets or set the request path from RequestPath.

PathBase

Gets or set the RequestPathBase.

Protocol

Gets or set the RequestProtocol.

Query

Gets the query value collection parsed from Request.QueryString.

QueryString

Gets or set the raw query string used to create the query collection in Request.Query.

Scheme

Gets or set the HTTP request scheme.

Methods

ReadFormAsync(CancellationToken)

Reads the request body if it is a form.

Extension Methods

GetMultipartBoundary(HttpRequest)
GetDisplayUrl(HttpRequest)
GetEncodedPathAndQuery(HttpRequest)
GetEncodedUrl(HttpRequest)
GetTypedHeaders(HttpRequest)
EnableRewind(HttpRequest, Int32, Nullable<Int64>)
ReadFormAsync(HttpRequest, FormOptions, CancellationToken)