Share via


RequestTransform.TakeHeader(RequestTransformContext, String) Method

Definition

Removes and returns the current header value by first checking the HttpRequestMessage, then the HttpContent, and falling back to the HttpContext only if HeadersCopied is not set. This ordering allows multiple transforms to mutate the same header.

public static Microsoft.Extensions.Primitives.StringValues TakeHeader(Yarp.ReverseProxy.Transforms.RequestTransformContext context, string headerName);
static member TakeHeader : Yarp.ReverseProxy.Transforms.RequestTransformContext * string -> Microsoft.Extensions.Primitives.StringValues
Public Shared Function TakeHeader (context As RequestTransformContext, headerName As String) As StringValues

Parameters

context
RequestTransformContext

The transform context.

headerName
String

The name of the header to take.

Returns

The requested header value, or StringValues.Empty if none.

Applies to