Class DiscoveryHttpClientHandler
An HttpClientHandler implementation that performs Service Discovery
public class DiscoveryHttpClientHandler : HttpClientHandler, IDisposable
- Inheritance
-
DiscoveryHttpClientHandler
- Implements
- Inherited Members
Constructors
DiscoveryHttpClientHandler(IDiscoveryClient, ILogger, ILoadBalancer)
Initializes a new instance of the DiscoveryHttpClientHandler class.
public DiscoveryHttpClientHandler(IDiscoveryClient discoveryClient, ILogger logger = null, ILoadBalancer loadBalancer = null)
Parameters
discoveryClientIDiscoveryClientService discovery client to use - provided by calling services.AddDiscoveryClient(Configuration)
loggerILoggerILogger for capturing logs from Discovery operations
loadBalancerILoadBalancerThe load balancer to use
Methods
SendAsync(HttpRequestMessage, CancellationToken)
Creates an instance of HttpResponseMessage based on the information provided in the HttpRequestMessage as an operation that will not block.
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
requestHttpRequestMessageThe HTTP request message.
cancellationTokenCancellationTokenA cancellation token to cancel the operation.
Returns
- Task<HttpResponseMessage>
The task object representing the asynchronous operation.
Exceptions
- ArgumentNullException
The
requestwas null.