Table of Contents

Class DiscoveryHttpClientHandler

Namespace
Steeltoe.Common.Discovery
Assembly
Steeltoe.Common.Http.dll

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

discoveryClient IDiscoveryClient

Service discovery client to use - provided by calling services.AddDiscoveryClient(Configuration)

logger ILogger

ILogger for capturing logs from Discovery operations

loadBalancer ILoadBalancer

The 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

request HttpRequestMessage

The HTTP request message.

cancellationToken CancellationToken

A cancellation token to cancel the operation.

Returns

Task<HttpResponseMessage>

The task object representing the asynchronous operation.

Exceptions

ArgumentNullException

The request was null.