Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IHttpRequestFeature Interface

Definition

Namespace:
Microsoft.AspNetCore.Http.Features
Assembly:
Microsoft.AspNetCore.Http.Features.dll
Package:
Microsoft.AspNetCore.Http.Features v1.0.0
Package:
Microsoft.AspNetCore.Http.Features v1.1.0
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Http.Features v2.0.0
Package:
Microsoft.AspNetCore.Http.Features v2.1.0
Package:
Microsoft.AspNetCore.Http.Features v2.2.0
Package:
Microsoft.AspNetCore.Http.Features v3.0.3
Package:
Microsoft.AspNetCore.Http.Features v3.1.18
Package:
Microsoft.AspNetCore.Http.Features v5.0.9
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
IHttpRequestFeature.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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 class IHttpRequestFeature
public interface IHttpRequestFeature
type IHttpRequestFeature = interface
Public Interface IHttpRequestFeature
Derived

Properties

Name Description
Body

Gets or sets a Stream representing the request body, if any.

Null may be used to represent an empty request body.

Headers

Gets or sets 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" }
Method

Gets or sets the request method as defined in RFC 7230. E.g. "GET", "HEAD", "POST", etc..

Path

Gets or sets the portion of the request path that identifies the requested resource.

The value may be Empty if PathBase contains the full path, or for 'OPTIONS *' requests. The path is fully decoded by the server except for '%2F', which would decode to '/' and change the meaning of the path segments. '%2F' can only be replaced after splitting the path into segments.

PathBase

Gets or sets the first portion of the request path associated with application root.

The value is un-escaped. The value may be Empty.

Protocol

Gets or set the HTTP-version as defined in RFC 7230. E.g. "HTTP/1.1"

QueryString

Gets or sets the query portion of the request-target as defined in RFC 7230. The value may be Empty. If not empty then the leading '?' will be included. The value is in its original form, without un-escaping.

RawTarget

Gets or sets the request target as it was sent in the HTTP request.

This property contains the raw path and full query, as well as other request targets such as * for OPTIONS requests (https://tools.ietf.org/html/rfc7230#section-5.3).

Scheme

Gets or 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.

Applies to


Feedback

Was this page helpful?