Table of Contents

UseHostingEnvironment Method

Definition

UseHostingEnvironment(IApplicationBuilder, Action<HostingEnvironmentOptions>)

Adds a hosting environment HTTP header to the IApplicationBuilder request execution pipeline.

public static IApplicationBuilder UseHostingEnvironment(this IApplicationBuilder builder, Action<HostingEnvironmentOptions> setup = null)

Parameters

builder IApplicationBuilder

The type that provides the mechanisms to configure an application’s request pipeline.

setup Action<HostingEnvironmentOptions>

The HostingEnvironmentOptions middleware which may be configured.

Returns

IApplicationBuilder

A reference to this instance after the operation has completed.

Remarks

Default HTTP header name is X-Hosting-Environment.