Class DiscoveryHttpClientHandler
- Namespace
- Steeltoe.Discovery.HttpClients
- Assembly
- Steeltoe.Discovery.HttpClients.dll
A HttpClientHandler that performs service discovery.
public sealed class DiscoveryHttpClientHandler : HttpClientHandler, IDisposable
- Inheritance
-
DiscoveryHttpClientHandler
- Implements
- Inherited Members
Constructors
DiscoveryHttpClientHandler(ILoadBalancer, TimeProvider)
Initializes a new instance of the DiscoveryHttpClientHandler class.
public DiscoveryHttpClientHandler(ILoadBalancer loadBalancer, TimeProvider timeProvider)
Parameters
loadBalancerILoadBalancerThe load balancer to use.
timeProviderTimeProviderProvides access to the system time.
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.