Table of Contents

Class SlimHttpClientFactory

Namespace
Cuemon.Extensions.Net.Http
Assembly
Cuemon.Extensions.Net.dll

Provides a simple and lightweight implementation of the System.Net.Http.IHttpClientFactory interface.

public class SlimHttpClientFactory : IHttpClientFactory, IHttpMessageHandlerFactory
Inheritance
Object
SlimHttpClientFactory
Implements
IHttpClientFactory
IHttpMessageHandlerFactory
Extension Methods

Remarks

Constructors

SlimHttpClientFactory(Func<HttpClientHandler>, Action<SlimHttpClientFactoryOptions>)

Initializes a new instance of the SlimHttpClientFactory class.

public SlimHttpClientFactory(Func<HttpClientHandler> handlerFactory, Action<SlimHttpClientFactoryOptions> setup = null)

Parameters

handlerFactory Func<HttpClientHandler>

The function delegate that creates and configures an System.Net.Http.HttpClientHandler.

setup Action<SlimHttpClientFactoryOptions>

The SlimHttpClientFactoryOptions which may be configured.

Methods

CreateClient(String)

Creates and configures an System.Net.Http.HttpClient instance using the configuration that corresponds to the logical name specified by name.

public HttpClient CreateClient(string name)

Parameters

name String

The logical name of the client to create.

Returns

HttpClient

A new System.Net.Http.HttpClient instance.

CreateHandler(String)

Creates and configures an System.Net.Http.HttpMessageHandler instance using the configuration that corresponds to the logical name specified by name.

public HttpMessageHandler CreateHandler(string name)

Parameters

name String

The logical name of the message handler to create.

Returns

HttpMessageHandler

A new System.Net.Http.HttpMessageHandler instance.

See Also

IHttpClientFactory
IHttpMessageHandlerFactory