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
contextHttpContextThe HttpContext to forward.
destinationPrefixstringThe url prefix for where to forward the request to.
httpClientHttpMessageInvokerThe HTTP client used to forward the request.
requestConfigForwarderRequestConfigConfig for the outgoing request.
transformerHttpTransformerRequest 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
contextHttpContextThe HttpContext to forward.
destinationPrefixstringThe url prefix for where to forward the request to.
httpClientHttpMessageInvokerThe HTTP client used to forward the request.
requestConfigForwarderRequestConfigConfig for the outgoing request.
transformerHttpTransformerRequest and response transforms. Use Default if custom transformations are not needed.
cancellationTokenCancellationTokenA cancellation token that can be used to abort the request.
Returns
- ValueTask<ForwarderError>
The result of forwarding the request and response.