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
loadBalancer
ILoadBalancerThe load balancer to use.
timeProvider
TimeProviderProvides 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
request
HttpRequestMessageThe HTTP request message.
cancellationToken
CancellationTokenA cancellation token to cancel the operation.
Returns
- Task<HttpResponseMessage>
The task object representing the asynchronous operation.
Exceptions
- ArgumentNullException
The
request
was null.