Прочетете на английски

Споделяне чрез


ResponseTransform.TakeHeader(ResponseTransformContext, String) Method

Definition

Removes and returns the current header value by first checking the HttpResponse and falling back to the value from HttpResponseMessage or HttpContent only if HeadersCopied is not set. This ordering allows multiple transforms to mutate the same header.

C#
public static Microsoft.Extensions.Primitives.StringValues TakeHeader (Yarp.ReverseProxy.Transforms.ResponseTransformContext context, string headerName);

Parameters

context
ResponseTransformContext

The transform context.

headerName
String

The name of the header to take.

Returns

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

Applies to

Продукт Версии
Yarp 1.0.1, 1.1.2, 2.0.1, 2.1.0, 2.2.0