Interface IHttpForwarder
- Namespace
- Yarp.ReverseProxy.Forwarder
- Assembly
- Yarp.ReverseProxy.dll
Forward an HTTP request to a chosen destination.
public interface IHttpForwarder
- Extension Methods
Methods
SendAsync(HttpContext, string, HttpMessageInvoker, ForwarderRequestConfig, HttpTransformer)
Forwards the incoming request to the destination server, and the response back to the client.
ValueTask<ForwarderError> SendAsync(HttpContext context, string destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer)
Parameters
context
HttpContextThe HttpContext to forward.
destinationPrefix
stringThe url prefix for where to forward the request to.
httpClient
HttpMessageInvokerThe HTTP client used to forward the request.
requestConfig
ForwarderRequestConfigConfig for the outgoing request.
transformer
HttpTransformerRequest and response transforms. Use Default if custom transformations are not needed.
Returns
- ValueTask<ForwarderError>
The result of forwarding the request and response.
SendAsync(HttpContext, string, HttpMessageInvoker, ForwarderRequestConfig, HttpTransformer, CancellationToken)
Forwards the incoming request to the destination server, and the response back to the client.
ValueTask<ForwarderError> SendAsync(HttpContext context, string destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer, CancellationToken cancellationToken)
Parameters
context
HttpContextThe HttpContext to forward.
destinationPrefix
stringThe url prefix for where to forward the request to.
httpClient
HttpMessageInvokerThe HTTP client used to forward the request.
requestConfig
ForwarderRequestConfigConfig for the outgoing request.
transformer
HttpTransformerRequest and response transforms. Use Default if custom transformations are not needed.
cancellationToken
CancellationTokenA cancellation token that can be used to abort the request.
Returns
- ValueTask<ForwarderError>
The result of forwarding the request and response.