HttpRequest HttpRequest HttpRequest HttpRequest Class

Definition

Represents the incoming side of an individual HTTP request.

public ref class HttpRequest abstract
public abstract class HttpRequest
type HttpRequest = class
Public MustInherit Class HttpRequest
Inheritance
HttpRequestHttpRequestHttpRequestHttpRequest

Constructors

HttpRequest() HttpRequest() HttpRequest() HttpRequest()

Properties

Body Body Body Body

Gets or sets the request body Stream.

BodyReader BodyReader BodyReader BodyReader

Gets the request body PipeReader.

ContentLength ContentLength ContentLength ContentLength

Gets or sets the Content-Length header.

ContentType ContentType ContentType ContentType

Gets or sets the Content-Type header.

Cookies Cookies Cookies Cookies

Gets the collection of Cookies for this request.

Form Form Form Form

Gets or sets the request body as a form.

HasFormContentType HasFormContentType HasFormContentType HasFormContentType

Checks the Content-Type header for form types.

Headers Headers Headers Headers

Gets the request headers.

Host Host Host Host

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

HttpContext HttpContext HttpContext HttpContext

Gets the HttpContext for this request.

IsHttps IsHttps IsHttps IsHttps

Returns true if the RequestScheme is https.

Method Method Method Method

Gets or sets the HTTP method.

Path Path Path Path

Gets or sets the request path from RequestPath.

PathBase PathBase PathBase PathBase

Gets or sets the RequestPathBase.

Protocol Protocol Protocol Protocol

Gets or sets the request protocol (e.g. HTTP/1.1).

Query Query Query Query

Gets the query value collection parsed from Request.QueryString.

QueryString QueryString QueryString QueryString

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

RouteValues RouteValues RouteValues RouteValues

Gets the collection of route values for this request.

Scheme Scheme Scheme Scheme

Gets or sets the HTTP request scheme.

Methods

ReadFormAsync(CancellationToken) ReadFormAsync(CancellationToken) ReadFormAsync(CancellationToken) ReadFormAsync(CancellationToken)

Reads the request body if it is a form.

Extension Methods

GetMultipartBoundary(HttpRequest) GetMultipartBoundary(HttpRequest) GetMultipartBoundary(HttpRequest) GetMultipartBoundary(HttpRequest)
GetDisplayUrl(HttpRequest) GetDisplayUrl(HttpRequest) GetDisplayUrl(HttpRequest) GetDisplayUrl(HttpRequest)

Returns the combined components of the request URL in a fully un-escaped form (except for the QueryString) suitable only for display. This format should not be used in HTTP headers or other HTTP operations.

GetEncodedPathAndQuery(HttpRequest) GetEncodedPathAndQuery(HttpRequest) GetEncodedPathAndQuery(HttpRequest) GetEncodedPathAndQuery(HttpRequest)

Returns the relative URI.

GetEncodedUrl(HttpRequest) GetEncodedUrl(HttpRequest) GetEncodedUrl(HttpRequest) GetEncodedUrl(HttpRequest)

Returns the combined components of the request URL in a fully escaped form suitable for use in HTTP headers and other HTTP operations.

GetTypedHeaders(HttpRequest) GetTypedHeaders(HttpRequest) GetTypedHeaders(HttpRequest) GetTypedHeaders(HttpRequest)
EnableBuffering(HttpRequest) EnableBuffering(HttpRequest) EnableBuffering(HttpRequest) EnableBuffering(HttpRequest)

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than 30K bytes to disk.

EnableBuffering(HttpRequest, Int32) EnableBuffering(HttpRequest, Int32) EnableBuffering(HttpRequest, Int32) EnableBuffering(HttpRequest, Int32)

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than bufferThreshold bytes to disk.

EnableBuffering(HttpRequest, Int32, Int64) EnableBuffering(HttpRequest, Int32, Int64) EnableBuffering(HttpRequest, Int32, Int64) EnableBuffering(HttpRequest, Int32, Int64)

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than bufferThreshold bytes to disk.

EnableBuffering(HttpRequest, Int64) EnableBuffering(HttpRequest, Int64) EnableBuffering(HttpRequest, Int64) EnableBuffering(HttpRequest, Int64)

Ensure the requestBody can be read multiple times. Normally buffers request bodies in memory; writes requests larger than 30K bytes to disk.

ReadFormAsync(HttpRequest, FormOptions, CancellationToken) ReadFormAsync(HttpRequest, FormOptions, CancellationToken) ReadFormAsync(HttpRequest, FormOptions, CancellationToken) ReadFormAsync(HttpRequest, FormOptions, CancellationToken)

Read the request body as a form with the given options. These options will only be used if the form has not already been read.

CheckTrailersAvailable(HttpRequest) CheckTrailersAvailable(HttpRequest) CheckTrailersAvailable(HttpRequest) CheckTrailersAvailable(HttpRequest)

Checks if the request supports trailers and they are available to be read now. This does not mean that there are any trailers to read.

GetDeclaredTrailers(HttpRequest) GetDeclaredTrailers(HttpRequest) GetDeclaredTrailers(HttpRequest) GetDeclaredTrailers(HttpRequest)

Gets the request "Trailer" header that lists which trailers to expect after the body.

GetTrailer(HttpRequest, String) GetTrailer(HttpRequest, String) GetTrailer(HttpRequest, String) GetTrailer(HttpRequest, String)

Gets the requested trailing header from the response. Check SupportsTrailers(HttpRequest) or a NotSupportedException may be thrown. Check CheckTrailersAvailable(HttpRequest) or an InvalidOperationException may be thrown.

SupportsTrailers(HttpRequest) SupportsTrailers(HttpRequest) SupportsTrailers(HttpRequest) SupportsTrailers(HttpRequest)

Indicates if the request supports receiving trailer headers.

Applies to