Note

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

Access to this page requires authorization. You can try .

IHttpResponseFeature 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:
IHttpResponseFeature.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.

Represents the fields and state of an HTTP response.

public interface class IHttpResponseFeature
public interface IHttpResponseFeature
type IHttpResponseFeature = interface
Public Interface IHttpResponseFeature
Derived

Properties

Name Description
Body
Obsolete.

Gets or sets the Stream for writing the response body.

HasStarted

Gets a value that indicates if the response has started.

If true, the StatusCode, ReasonPhrase, and Headers are now immutable, and OnStarting(Func<Object,Task>, Object) should no longer be called.

Headers

Gets or sets the response headers to send. Headers with multiple values will be emitted as multiple headers.

ReasonPhrase

Gets or sets the reason-phrase as defined in RFC 9112 Section 4. Note this field is no longer supported by HTTP/2.

StatusCode

Gets or sets the status-code as defined in RFC 7230.

Methods

Name Description
OnCompleted(Func<Object,Task>, Object)

Registers a callback to be invoked after a response has fully completed. This is intended for resource cleanup.

OnStarting(Func<Object,Task>, Object)

Registers a callback to be invoked just before the response starts.

This is the last chance to modify the Headers, StatusCode, or ReasonPhrase.

Applies to


Feedback

Was this page helpful?