1 implementation of IHttpClientBuilder
Microsoft.Extensions.Http (1)
DependencyInjection\DefaultHttpClientBuilder.cs (1)
9internal sealed class DefaultHttpClientBuilder : IHttpClientBuilder
197 references to IHttpClientBuilder
Microsoft.AspNetCore.HeaderPropagation (9)
DependencyInjection\HeaderPropagationHttpClientBuilderExtensions.cs (9)
10/// <see cref="IHttpClientBuilder"/> extension methods for <see cref="HeaderPropagationMiddleware"/> which propagates request headers to an <see cref="System.Net.Http.HttpClient"/>. 20/// <param name="builder">The <see cref="IHttpClientBuilder"/> to add the message handler to.</param> 21/// <returns>The <see cref="IHttpClientBuilder"/> so that additional calls can be chained.</returns> 22public static IHttpClientBuilder AddHeaderPropagation(this IHttpClientBuilder builder) 48/// <param name="builder">The <see cref="IHttpClientBuilder"/> to add the message handler to.</param> 50/// <returns>The <see cref="IHttpClientBuilder"/> so that additional calls can be chained.</returns> 51public static IHttpClientBuilder AddHeaderPropagation(this IHttpClientBuilder builder, Action<HeaderPropagationMessageHandlerOptions> configure)
Microsoft.AspNetCore.HeaderPropagation.Tests (1)
HeaderPropagationIntegrationTest.cs (1)
209var client = services.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com"))
Microsoft.Extensions.Http (156)
DependencyInjection\HttpClientBuilderExtensions.cs (98)
18/// Extension methods for configuring an <see cref="IHttpClientBuilder"/> 25/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 27/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 28public static IHttpClientBuilder ConfigureHttpClient(this IHttpClientBuilder builder, Action<HttpClient> configureClient) 41/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 43/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 48public static IHttpClientBuilder ConfigureHttpClient(this IHttpClientBuilder builder, Action<IServiceProvider, HttpClient> configureClient) 67/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 69/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 74public static IHttpClientBuilder AddHttpMessageHandler(this IHttpClientBuilder builder, Func<DelegatingHandler> configureHandler) 90/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 91/// <param name="configureHandler">A delegate that is used to create a <see cref="DelegatingHandler"/>.</param> /// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 102public static IHttpClientBuilder AddHttpMessageHandler(this IHttpClientBuilder builder, Func<IServiceProvider, DelegatingHandler> configureHandler) 118/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 119/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 129public static IHttpClientBuilder AddHttpMessageHandler<THandler>(this IHttpClientBuilder builder) 146/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 148/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 153public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Func<HttpMessageHandler> configureHandler) 170/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 172/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 183public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Func<IServiceProvider, HttpMessageHandler> configureHandler) 200/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 201/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 211public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler<THandler>(this IHttpClientBuilder builder) 228/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 230/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 237public static IHttpClientBuilder ConfigurePrimaryHttpMessageHandler(this IHttpClientBuilder builder, Action<HttpMessageHandler, IServiceProvider> configureHandler) 254/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 256/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 258public static IHttpClientBuilder ConfigureHttpMessageHandlerBuilder(this IHttpClientBuilder builder, Action<HttpMessageHandlerBuilder> configureBuilder) 273/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 275/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 279/// <see cref="ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func{HttpMessageHandler})"/> or 280/// <see cref="UseSocketsHttpHandler(IHttpClientBuilder, Action{ISocketsHttpHandlerBuilder})"/>, then the passed <paramref name="configureHandler"/> 285public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder builder, Action<SocketsHttpHandler, IServiceProvider>? configureHandler = null) 309/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 312/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 316/// <see cref="ConfigurePrimaryHttpMessageHandler(IHttpClientBuilder, Func{HttpMessageHandler})"/> or 317/// <see cref="UseSocketsHttpHandler(IHttpClientBuilder, Action{ISocketsHttpHandlerBuilder})"/>, then the configuration set on 323public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder builder, Action<ISocketsHttpHandlerBuilder> configureBuilder) 336/// associated with the <see cref="IHttpClientBuilder"/>. 342/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 350/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder)"/> will register a typed 359public static IHttpClientBuilder AddTypedClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>( 360this IHttpClientBuilder builder) 368internal static IHttpClientBuilder AddTypedClientCore<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>( 369this IHttpClientBuilder builder, bool validateSingleType) 386private static TClient AddTransientHelper<TClient>(IServiceProvider s, IHttpClientBuilder builder) where TClient : class 397/// associated with the <see cref="IHttpClientBuilder"/>. The created instances will be of type 408/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 416/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient,TImplementation}(IHttpClientBuilder)"/> 426public static IHttpClientBuilder AddTypedClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 427this IHttpClientBuilder builder) 436internal static IHttpClientBuilder AddTypedClientCore<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 437this IHttpClientBuilder builder, bool validateSingleType) 450private static TClient AddTransientHelper<TClient, TImplementation>(IServiceProvider s, IHttpClientBuilder builder) where TClient : class where TImplementation : class, TClient 461/// associated with the <see cref="IHttpClientBuilder"/>. 467/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 476/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder,Func{HttpClient,TClient})"/> 480public static IHttpClientBuilder AddTypedClient<TClient>(this IHttpClientBuilder builder, Func<HttpClient, TClient> factory) 489internal static IHttpClientBuilder AddTypedClientCore<TClient>(this IHttpClientBuilder builder, Func<HttpClient, TClient> factory, bool validateSingleType) 507/// associated with the <see cref="IHttpClientBuilder"/>. 513/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 522/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder,Func{HttpClient,IServiceProvider,TClient})"/> 526public static IHttpClientBuilder AddTypedClient<TClient>(this IHttpClientBuilder builder, Func<HttpClient, IServiceProvider, TClient> factory) 535internal static IHttpClientBuilder AddTypedClientCore<TClient>(this IHttpClientBuilder builder, Func<HttpClient, IServiceProvider, TClient> factory, bool validateSingleType) 557/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 559/// <returns>The <see cref="IHttpClientBuilder"/>.</returns> 562public static IHttpClientBuilder RedactLoggedHeaders(this IHttpClientBuilder builder, Func<string, bool> shouldRedactHeaderValue) 578/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 580/// <returns>The <see cref="IHttpClientBuilder"/>.</returns> 581public static IHttpClientBuilder RedactLoggedHeaders(this IHttpClientBuilder builder, IEnumerable<string> redactedLoggedHeaderNames) 620public static IHttpClientBuilder SetHandlerLifetime(this IHttpClientBuilder builder, TimeSpan handlerLifetime) 637/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 639/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 640public static IHttpClientBuilder ConfigureAdditionalHttpMessageHandlers(this IHttpClientBuilder builder, Action<IList<DelegatingHandler>, IServiceProvider> configureAdditionalHandlers) 654private static void ReserveClient(IHttpClientBuilder builder, Type type, string name, bool validateSingleType)
DependencyInjection\HttpClientBuilderExtensions.Logging.cs (16)
16/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 21/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 46public static IHttpClientBuilder AddLogger(this IHttpClientBuilder builder, Func<IServiceProvider, IHttpClientLogger> httpClientLoggerFactory, bool wrapHandlersPipeline = false) 76/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 79/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 108public static IHttpClientBuilder AddLogger<TLogger>(this IHttpClientBuilder builder, bool wrapHandlersPipeline = false) 119/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 120/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 121public static IHttpClientBuilder RemoveAllLoggers(this IHttpClientBuilder builder) 137/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 138/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 139public static IHttpClientBuilder AddDefaultLogger(this IHttpClientBuilder builder)
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (40)
78/// <param name="configure">A delegate that is used to configure an <see cref="IHttpClientBuilder"/>.</param> 80public static IServiceCollection ConfigureHttpClientDefaults(this IServiceCollection services, Action<IHttpClientBuilder> configure) 98/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 108public static IHttpClientBuilder AddHttpClient(this IServiceCollection services, string name) 125/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 135public static IHttpClientBuilder AddHttpClient(this IServiceCollection services, string name, Action<HttpClient> configureClient) 155/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 165public static IHttpClientBuilder AddHttpClient(this IServiceCollection services, string name, Action<IServiceProvider, HttpClient> configureClient) 188/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 200public static IHttpClientBuilder AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>( 228/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 240public static IHttpClientBuilder AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 265/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 280public static IHttpClientBuilder AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>( 308/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 323public static IHttpClientBuilder AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 349/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 361public static IHttpClientBuilder AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>( 388/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 400public static IHttpClientBuilder AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>( 431/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 443public static IHttpClientBuilder AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 475/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 487public static IHttpClientBuilder AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 515/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 530public static IHttpClientBuilder AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>( 557/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 572public static IHttpClientBuilder AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>( 603/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 618public static IHttpClientBuilder AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 650/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 665public static IHttpClientBuilder AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>( 695/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 707public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, Func<HttpClient, TImplementation> factory) 732/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 746public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, string name, Func<HttpClient, TImplementation> factory) 774/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 786public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, Func<HttpClient, IServiceProvider, TImplementation> factory) 811/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 823public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, string name, Func<HttpClient, IServiceProvider, TImplementation> factory)
HttpClientFactoryOptions.cs (1)
99/// <see cref="HttpClientBuilderExtensions.AddHttpMessageHandler{THandler}(IHttpClientBuilder)"/>.
ITypedHttpClientFactory.cs (1)
20/// <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder)"/> functionality. This type
Microsoft.Extensions.Http.Polly (31)
DependencyInjection\PollyHttpClientBuilderExtensions.cs (29)
23/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 25/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 31public static IHttpClientBuilder AddPolicyHandler(this IHttpClientBuilder builder, IAsyncPolicy<HttpResponseMessage> policy) 51/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 55/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 61public static IHttpClientBuilder AddPolicyHandler( 62this IHttpClientBuilder builder, 83/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 87/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 93public static IHttpClientBuilder AddPolicyHandler( 94this IHttpClientBuilder builder, 118/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 122/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 128public static IHttpClientBuilder AddPolicyHandlerFromRegistry(this IHttpClientBuilder builder, string policyKey) 155/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 159/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 165public static IHttpClientBuilder AddPolicyHandlerFromRegistry( 166this IHttpClientBuilder builder, 192/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 194/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 212/// <see cref="AddPolicyHandler(IHttpClientBuilder, IAsyncPolicy{HttpResponseMessage})"/> as desired. 215public static IHttpClientBuilder AddTransientHttpErrorPolicy( 216this IHttpClientBuilder builder, 242/// <param name="builder">The <see cref="IHttpClientBuilder"/>.</param> 245/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns> 254public static IHttpClientBuilder AddPolicyHandler(this IHttpClientBuilder builder, Func<IServiceProvider, HttpRequestMessage, string, IAsyncPolicy<HttpResponseMessage>> policyFactory, Func<HttpRequestMessage, string> keySelector)
PolicyHttpMessageHandler.cs (2)
30/// The <see cref="PollyHttpClientBuilderExtensions.AddPolicyHandler(IHttpClientBuilder, IAsyncPolicy{HttpResponseMessage})"/> 49/// The <see cref="PollyHttpClientBuilderExtensions.AddTransientHttpErrorPolicy(IHttpClientBuilder, Func{PolicyBuilder{HttpResponseMessage}, IAsyncPolicy{HttpResponseMessage}})"/>