Del via


IForwarderHttpClientFactory.CreateClient(ForwarderHttpClientContext) Method

Definition

Creates and configures an HttpMessageInvoker instance that can be used for forwarding requests to an upstream server.

public System.Net.Http.HttpMessageInvoker CreateClient (Yarp.ReverseProxy.Forwarder.ForwarderHttpClientContext context);
abstract member CreateClient : Yarp.ReverseProxy.Forwarder.ForwarderHttpClientContext -> System.Net.Http.HttpMessageInvoker
Public Function CreateClient (context As ForwarderHttpClientContext) As HttpMessageInvoker

Parameters

context
ForwarderHttpClientContext

An ForwarderHttpClientContext carrying old and new cluster configurations.

Returns

Remarks

A call to CreateClient(ForwarderHttpClientContext) can return either a new HttpMessageInvoker instance or an old one if the configuration has not changed. If the old configuration is null, a new HttpMessageInvoker is always created. The returned HttpMessageInvoker instance MUST NOT be disposed because it can be used concurrently by several in-flight requests.

Applies to