Interface IHttpForwarder
Forward an HTTP request to a chosen destination.
Namespace: Yarp.ReverseProxy.Forwarder
Assembly: Yarp.ReverseProxy.dll
Syntax
public interface IHttpForwarder
Methods
| Improve this Doc View SourceSendAsync(HttpContext, String, HttpMessageInvoker, ForwarderRequestConfig, HttpTransformer)
Forwards the incoming request to the destination server, and the response back to the client.
Declaration
ValueTask<ForwarderError> SendAsync(HttpContext context, string destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | The HttpContext to forward. |
System.String | destinationPrefix | The url prefix for where to forward the request to. |
HttpMessageInvoker | httpClient | The HTTP client used to forward the request. |
ForwarderRequestConfig | requestConfig | Config for the outgoing request. |
HttpTransformer | transformer | Request and response transforms. Use Default if custom transformations are not needed. |
Returns
Type | Description |
---|---|
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.
Declaration
virtual ValueTask<ForwarderError> SendAsync(HttpContext context, string destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | context | The HttpContext to forward. |
System.String | destinationPrefix | The url prefix for where to forward the request to. |
HttpMessageInvoker | httpClient | The HTTP client used to forward the request. |
ForwarderRequestConfig | requestConfig | Config for the outgoing request. |
HttpTransformer | transformer | Request and response transforms. Use Default if custom transformations are not needed. |
CancellationToken | cancellationToken | A cancellation token that can be used to abort the request. |
Returns
Type | Description |
---|---|
ValueTask<ForwarderError> | The result of forwarding the request and response. |