EasyAF_Http_IServiceCollectionExtensions

Provides extension methods for registering EasyAF HTTP clients in the dependency injection container. Automatically configures HttpClient instances based on configuration attributes.

Syntax

public static class EasyAF_Http_IServiceCollectionExtensions

Inheritance

Methods

AddHttpClients<TConfig, TMessageHandler>

public static IServiceCollection AddHttpClients<TConfig, TMessageHandler>(this IServiceCollection services, TConfig config, HttpHandlerMode httpHandlerMode) where TConfig : ConfigurationBase where TMessageHandler : DelegatingHandler
Adds HTTP clients to the service collection based on configuration properties marked with . Allows explicit specification of the HttpHandlerMode for message handler configuration.

Parameters

  • services IServiceCollection: The service collection to add HTTP clients to.
  • config TConfig: The configuration instance containing endpoint definitions.
  • httpHandlerMode HttpHandlerMode: Specifies how message handlers should be configured for the HTTP clients.

Returns

IServiceCollection The service collection for method chaining.

AddHttpClients<TConfig, TMessageHandler>

public static IServiceCollection AddHttpClients<TConfig, TMessageHandler>(this IServiceCollection services, TConfig config) where TConfig : ConfigurationBase where TMessageHandler : DelegatingHandler
Adds HTTP clients to the service collection based on configuration properties marked with . Uses the default HttpHandlerMode from the configuration.

Parameters

  • services IServiceCollection: The service collection to add HTTP clients to.
  • config TConfig: The configuration instance containing endpoint definitions.

Returns

IServiceCollection The service collection for method chaining.