Table of Contents

Class IHttpForwarderExtensions

Namespace
Yarp.ReverseProxy.Forwarder
Assembly
Yarp.ReverseProxy.dll

Extensions methods for IHttpForwarder.

public static class IHttpForwarderExtensions
Inheritance
IHttpForwarderExtensions
Inherited Members

Methods

SendAsync(IHttpForwarder, HttpContext, string, HttpMessageInvoker)

Forwards the incoming request to the destination server, and the response back to the client.

public static ValueTask<ForwarderError> SendAsync(this IHttpForwarder forwarder, HttpContext context, string destinationPrefix, HttpMessageInvoker httpClient)

Parameters

forwarder IHttpForwarder

The forwarder instance.

context HttpContext

The HttpContext to forward.

destinationPrefix string

The url prefix for where to forward the request to.

httpClient HttpMessageInvoker

The HTTP client used to forward the request.

Returns

ValueTask<ForwarderError>

The status of a forwarding operation.

SendAsync(IHttpForwarder, HttpContext, string, HttpMessageInvoker, Func<HttpContext, HttpRequestMessage, ValueTask>)

Forwards the incoming request to the destination server, and the response back to the client.

public static ValueTask<ForwarderError> SendAsync(this IHttpForwarder forwarder, HttpContext context, string destinationPrefix, HttpMessageInvoker httpClient, Func<HttpContext, HttpRequestMessage, ValueTask> requestTransform)

Parameters

forwarder IHttpForwarder

The forwarder instance.

context HttpContext

The HttpContext to forward.

destinationPrefix string

The url prefix for where to forward the request to.

httpClient HttpMessageInvoker

The HTTP client used to forward the request.

requestTransform Func<HttpContext, HttpRequestMessage, ValueTask>

Transform function to apply to the forwarded request.

Returns

ValueTask<ForwarderError>

The status of a forwarding operation.

SendAsync(IHttpForwarder, HttpContext, string, HttpMessageInvoker, ForwarderRequestConfig)

Forwards the incoming request to the destination server, and the response back to the client.

public static ValueTask<ForwarderError> SendAsync(this IHttpForwarder forwarder, HttpContext context, string destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig)

Parameters

forwarder IHttpForwarder

The forwarder instance.

context HttpContext

The HttpContext to forward.

destinationPrefix string

The url prefix for where to forward the request to.

httpClient HttpMessageInvoker

The HTTP client used to forward the request.

requestConfig ForwarderRequestConfig

Config for the outgoing request.

Returns

ValueTask<ForwarderError>

The status of a forwarding operation.

SendAsync(IHttpForwarder, HttpContext, string, HttpMessageInvoker, ForwarderRequestConfig, Func<HttpContext, HttpRequestMessage, ValueTask>)

Forwards the incoming request to the destination server, and the response back to the client.

public static ValueTask<ForwarderError> SendAsync(this IHttpForwarder forwarder, HttpContext context, string destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, Func<HttpContext, HttpRequestMessage, ValueTask> requestTransform)

Parameters

forwarder IHttpForwarder

The forwarder instance.

context HttpContext

The HttpContext to forward.

destinationPrefix string

The url prefix for where to forward the request to.

httpClient HttpMessageInvoker

The HTTP client used to forward the request.

requestConfig ForwarderRequestConfig

Config for the outgoing request.

requestTransform Func<HttpContext, HttpRequestMessage, ValueTask>

Transform function to apply to the forwarded request.

Returns

ValueTask<ForwarderError>

The status of a forwarding operation.