1 implementation of IHttpClientBuilder
Microsoft.Extensions.Http (1)
DependencyInjection\DefaultHttpClientBuilder.cs (1)
9
internal sealed class DefaultHttpClientBuilder :
IHttpClientBuilder
268 references to IHttpClientBuilder
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
194
public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, string? endpointName, Action<
IHttpClientBuilder
> configure)
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>
22
public 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>
51
public static
IHttpClientBuilder
AddHeaderPropagation(this
IHttpClientBuilder
builder, Action<HeaderPropagationMessageHandlerOptions> configure)
Microsoft.AspNetCore.HeaderPropagation.Tests (1)
HeaderPropagationIntegrationTest.cs (1)
209
var
client = services.AddHttpClient("example.com", c => c.BaseAddress = new Uri("http://example.com"))
Microsoft.Extensions.Http (166)
DependencyInjection\HttpClientBuilderExtensions.cs (108)
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>
28
public 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>
48
public 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>
74
public static
IHttpClientBuilder
AddHttpMessageHandler(this
IHttpClientBuilder
builder, Func<DelegatingHandler> configureHandler)
90
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
92
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
103
public static
IHttpClientBuilder
AddHttpMessageHandler(this
IHttpClientBuilder
builder, Func<IServiceProvider, DelegatingHandler> configureHandler)
119
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
120
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
130
public static
IHttpClientBuilder
AddHttpMessageHandler<THandler>(this
IHttpClientBuilder
builder)
147
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
149
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
154
public static
IHttpClientBuilder
ConfigurePrimaryHttpMessageHandler(this
IHttpClientBuilder
builder, Func<HttpMessageHandler> configureHandler)
171
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
173
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
184
public static
IHttpClientBuilder
ConfigurePrimaryHttpMessageHandler(this
IHttpClientBuilder
builder, Func<IServiceProvider, HttpMessageHandler> configureHandler)
201
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
202
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
212
public static
IHttpClientBuilder
ConfigurePrimaryHttpMessageHandler<THandler>(this
IHttpClientBuilder
builder)
229
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
231
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
238
public static
IHttpClientBuilder
ConfigurePrimaryHttpMessageHandler(this
IHttpClientBuilder
builder, Action<HttpMessageHandler, IServiceProvider> configureHandler)
255
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
257
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
259
public static
IHttpClientBuilder
ConfigureHttpMessageHandlerBuilder(this
IHttpClientBuilder
builder, Action<HttpMessageHandlerBuilder> configureBuilder)
274
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
276
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
280
/// <see cref="ConfigurePrimaryHttpMessageHandler(
IHttpClientBuilder
, Func{HttpMessageHandler})"/> or
281
/// <see cref="UseSocketsHttpHandler(
IHttpClientBuilder
, Action{ISocketsHttpHandlerBuilder})"/>, then the passed <paramref name="configureHandler"/>
286
public static
IHttpClientBuilder
UseSocketsHttpHandler(this
IHttpClientBuilder
builder, Action<SocketsHttpHandler, IServiceProvider>? configureHandler = null)
310
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
313
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
317
/// <see cref="ConfigurePrimaryHttpMessageHandler(
IHttpClientBuilder
, Func{HttpMessageHandler})"/> or
318
/// <see cref="UseSocketsHttpHandler(
IHttpClientBuilder
, Action{ISocketsHttpHandlerBuilder})"/>, then the configuration set on
324
public static
IHttpClientBuilder
UseSocketsHttpHandler(this
IHttpClientBuilder
builder, Action<ISocketsHttpHandlerBuilder> configureBuilder)
337
/// associated with the <see cref="
IHttpClientBuilder
"/>.
343
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
351
/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(
IHttpClientBuilder
)"/> will register a typed
360
public static
IHttpClientBuilder
AddTypedClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>(
361
this
IHttpClientBuilder
builder)
369
internal static
IHttpClientBuilder
AddTypedClientCore<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>(
370
this
IHttpClientBuilder
builder, bool validateSingleType)
382
private static TClient AddTransientHelper<TClient>(IServiceProvider s,
IHttpClientBuilder
builder) where TClient : class
393
/// associated with the <see cref="
IHttpClientBuilder
"/>. The created instances will be of type
404
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
412
/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient,TImplementation}(
IHttpClientBuilder
)"/>
422
public static
IHttpClientBuilder
AddTypedClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
423
this
IHttpClientBuilder
builder)
432
internal static
IHttpClientBuilder
AddTypedClientCore<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
433
this
IHttpClientBuilder
builder, bool validateSingleType)
446
private static TClient AddTransientHelper<TClient, TImplementation>(IServiceProvider s,
IHttpClientBuilder
builder) where TClient : class where TImplementation : class, TClient
457
/// associated with the <see cref="
IHttpClientBuilder
"/>.
463
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
472
/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(
IHttpClientBuilder
,Func{HttpClient,TClient})"/>
476
public static
IHttpClientBuilder
AddTypedClient<TClient>(this
IHttpClientBuilder
builder, Func<HttpClient, TClient> factory)
485
internal static
IHttpClientBuilder
AddTypedClientCore<TClient>(this
IHttpClientBuilder
builder, Func<HttpClient, TClient> factory, bool validateSingleType)
503
/// associated with the <see cref="
IHttpClientBuilder
"/>.
509
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
518
/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(
IHttpClientBuilder
,Func{HttpClient,IServiceProvider,TClient})"/>
522
public static
IHttpClientBuilder
AddTypedClient<TClient>(this
IHttpClientBuilder
builder, Func<HttpClient, IServiceProvider, TClient> factory)
531
internal static
IHttpClientBuilder
AddTypedClientCore<TClient>(this
IHttpClientBuilder
builder, Func<HttpClient, IServiceProvider, TClient> factory, bool validateSingleType)
553
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
555
/// <returns>The <see cref="
IHttpClientBuilder
"/>.</returns>
558
public static
IHttpClientBuilder
RedactLoggedHeaders(this
IHttpClientBuilder
builder, Func<string, bool> shouldRedactHeaderValue)
574
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
576
/// <returns>The <see cref="
IHttpClientBuilder
"/>.</returns>
577
public static
IHttpClientBuilder
RedactLoggedHeaders(this
IHttpClientBuilder
builder, IEnumerable<string> redactedLoggedHeaderNames)
616
public static
IHttpClientBuilder
SetHandlerLifetime(this
IHttpClientBuilder
builder, TimeSpan handlerLifetime)
633
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
635
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
636
public static
IHttpClientBuilder
ConfigureAdditionalHttpMessageHandlers(this
IHttpClientBuilder
builder, Action<IList<DelegatingHandler>, IServiceProvider> configureAdditionalHandlers)
654
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
656
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
682
/// If used in conjunction with <see cref="HttpClientFactoryServiceCollectionExtensions.ConfigureHttpClientDefaults(IServiceCollection, Action{
IHttpClientBuilder
})"/>,
687
public static
IHttpClientBuilder
AddAsKeyed(this
IHttpClientBuilder
builder, ServiceLifetime lifetime = ServiceLifetime.Scoped)
720
/// <param name="builder">The <see cref="
IHttpClientBuilder
"/>.</param>
721
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
724
/// If used in conjunction with <see cref="HttpClientFactoryServiceCollectionExtensions.ConfigureHttpClientDefaults(IServiceCollection, Action{
IHttpClientBuilder
})"/>,
729
public static
IHttpClientBuilder
RemoveAsKeyed(this
IHttpClientBuilder
builder)
755
private 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>
46
public 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>
108
public 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>
121
public 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>
139
public 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>
80
public static IServiceCollection ConfigureHttpClientDefaults(this IServiceCollection services, Action<
IHttpClientBuilder
> configure)
98
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
108
public static
IHttpClientBuilder
AddHttpClient(this IServiceCollection services, string name)
125
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
135
public 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>
165
public 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>
200
public static
IHttpClientBuilder
AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>(
228
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
240
public static
IHttpClientBuilder
AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
265
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
280
public static
IHttpClientBuilder
AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>(
308
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
323
public static
IHttpClientBuilder
AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
349
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
361
public static
IHttpClientBuilder
AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>(
388
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
400
public static
IHttpClientBuilder
AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>(
431
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
443
public static
IHttpClientBuilder
AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
475
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
487
public static
IHttpClientBuilder
AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
515
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
530
public static
IHttpClientBuilder
AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>(
557
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
572
public static
IHttpClientBuilder
AddHttpClient<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TClient>(
603
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
618
public static
IHttpClientBuilder
AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
650
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
665
public static
IHttpClientBuilder
AddHttpClient<TClient, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TImplementation>(
695
/// <returns>An <see cref="
IHttpClientBuilder
"/> that can be used to configure the client.</returns>
707
public 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>
746
public 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>
786
public 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>
823
public static
IHttpClientBuilder
AddHttpClient<TClient, TImplementation>(this IServiceCollection services, string name, Func<HttpClient, IServiceProvider, TImplementation> factory)
HttpClientFactoryOptions.cs (1)
100
/// <see cref="HttpClientBuilderExtensions.AddHttpMessageHandler{THandler}(
IHttpClientBuilder
)"/>.
ITypedHttpClientFactory.cs (1)
20
/// <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(
IHttpClientBuilder
)"/> functionality. This type
Microsoft.Extensions.Http.Diagnostics (17)
Logging\HttpClientLoggingHttpClientBuilderExtensions.cs (14)
25
/// <param name="builder">The <see cref="
IHttpClientBuilder
" />.</param>
28
/// All other loggers are removed - including the default one, registered via <see cref="HttpClientBuilderExtensions.AddDefaultLogger(
IHttpClientBuilder
)"/>.
33
public static
IHttpClientBuilder
AddExtendedHttpClientLogging(this
IHttpClientBuilder
builder)
43
/// <param name="builder">The <see cref="
IHttpClientBuilder
" />.</param>
47
/// All other loggers are removed - including the default one, registered via <see cref="HttpClientBuilderExtensions.AddDefaultLogger(
IHttpClientBuilder
)"/>.
52
public static
IHttpClientBuilder
AddExtendedHttpClientLogging(this
IHttpClientBuilder
builder, IConfigurationSection section)
63
/// <param name="builder">The <see cref="
IHttpClientBuilder
" />.</param>
67
/// All other loggers are removed - including the default one, registered via <see cref="HttpClientBuilderExtensions.AddDefaultLogger(
IHttpClientBuilder
)"/>.
72
public static
IHttpClientBuilder
AddExtendedHttpClientLogging(this
IHttpClientBuilder
builder, Action<LoggingOptions> configure)
80
private static
IHttpClientBuilder
AddExtendedHttpClientLoggingInternal(
IHttpClientBuilder
builder, Action<OptionsBuilder<LoggingOptions>>? configureOptionsBuilder = null)
Logging\HttpClientLoggingServiceCollectionExtensions.cs (3)
28
/// All other loggers are removed - including the default one, registered via <see cref="HttpClientBuilderExtensions.AddDefaultLogger(
IHttpClientBuilder
)"/>.
58
/// All other loggers are removed - including the default one, registered via <see cref="HttpClientBuilderExtensions.AddDefaultLogger(
IHttpClientBuilder
)"/>.
80
/// All other loggers are removed - including the default one, registered via <see cref="HttpClientBuilderExtensions.AddDefaultLogger(
IHttpClientBuilder
)"/>.
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Logging\HttpClientLoggingExtensionsTest.cs (5)
37
var act = () => ((
IHttpClientBuilder
)null!).AddExtendedHttpClientLogging();
40
act = () => ((
IHttpClientBuilder
)null!).AddExtendedHttpClientLogging(_ => { });
43
act = () => ((
IHttpClientBuilder
)null!).AddExtendedHttpClientLogging(Mock.Of<IConfigurationSection>());
46
act = () => Mock.Of<
IHttpClientBuilder
>().AddExtendedHttpClientLogging((Action<LoggingOptions>)null!);
49
act = () => Mock.Of<
IHttpClientBuilder
>().AddExtendedHttpClientLogging((IConfigurationSection)null!);
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>
31
public 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>
61
public static
IHttpClientBuilder
AddPolicyHandler(
62
this
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>
93
public static
IHttpClientBuilder
AddPolicyHandler(
94
this
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>
128
public 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>
165
public static
IHttpClientBuilder
AddPolicyHandlerFromRegistry(
166
this
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.
215
public static
IHttpClientBuilder
AddTransientHttpErrorPolicy(
216
this
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>
254
public 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}})"/>
Microsoft.Extensions.Http.Resilience (12)
Hedging\ResilienceHttpClientBuilderExtensions.Hedging.cs (3)
20
/// Extensions for <see cref="
IHttpClientBuilder
"/>.
42
public static IStandardHedgingHandlerBuilder AddStandardHedgingHandler(this
IHttpClientBuilder
builder, Action<IRoutingStrategyBuilder> configure)
71
public static IStandardHedgingHandlerBuilder AddStandardHedgingHandler(this
IHttpClientBuilder
builder)
Resilience\ResilienceHttpClientBuilderExtensions.Resilience.cs (6)
18
/// Extensions for <see cref="
IHttpClientBuilder
"/>.
30
/// The final pipeline name is combination of <see cref="
IHttpClientBuilder
.Name"/> and <paramref name="pipelineName"/>.
34
this
IHttpClientBuilder
builder,
53
/// The final pipeline name is combination of <see cref="
IHttpClientBuilder
.Name"/> and <paramref name="pipelineName"/>.
57
this
IHttpClientBuilder
builder,
111
this
IHttpClientBuilder
builder,
Resilience\ResilienceHttpClientBuilderExtensions.StandardResilience.cs (3)
31
public static IHttpStandardResiliencePipelineBuilder AddStandardResilienceHandler(this
IHttpClientBuilder
builder, IConfigurationSection section)
49
public static IHttpStandardResiliencePipelineBuilder AddStandardResilienceHandler(this
IHttpClientBuilder
builder, Action<HttpStandardResilienceOptions> configure)
66
public static IHttpStandardResiliencePipelineBuilder AddStandardResilienceHandler(this
IHttpClientBuilder
builder)
Microsoft.Extensions.Http.Resilience.PerformanceTests (1)
HttpClientFactory.cs (1)
67
var
clientBuilder = services.AddHttpClient(clientType.ToString(), client => client.Timeout = Timeout.InfiniteTimeSpan);
Microsoft.Extensions.Http.Resilience.Tests (21)
Hedging\HedgingTests.cs (2)
41
private protected HedgingTests(Func<
IHttpClientBuilder
, Func<RequestRoutingStrategy>, TBuilder> createDefaultBuilder)
50
var
httpClient = _services.AddHttpClient(ClientId);
Hedging\StandardHedgingTests.cs (1)
33
private static IStandardHedgingHandlerBuilder ConfigureDefaultBuilder(
IHttpClientBuilder
builder, Func<RequestRoutingStrategy> factory)
Resilience\GrpcResilienceTests.cs (2)
96
private Greeter.GreeterClient CreateClient(Action<
IHttpClientBuilder
>? configure = null)
99
var
clientBuilder = services
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (7)
29
IHttpClientBuilder
? builder = services.AddHttpClient("client");
47
IHttpClientBuilder
? builder = services.AddHttpClient("client");
67
IHttpClientBuilder
? builder = services
90
IHttpClientBuilder
? builder = services.AddHttpClient("client");
170
IHttpClientBuilder
? builder = services.AddHttpClient("client");
205
var
builder = services.AddHttpClient("client");
254
var
clientBuilder = services.AddHttpClient("client");
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (9)
26
private readonly
IHttpClientBuilder
_builder;
105
IHttpClientBuilder
builder = null!;
115
var
builder = new ServiceCollection().AddHttpClient("test");
126
var
builder = new ServiceCollection().AddHttpClient("test");
136
var
builder = new ServiceCollection().AddHttpClient("test");
146
var
builder = new ServiceCollection().AddLogging().AddMetrics().AddHttpClient("test");
182
var
builder = new ServiceCollection().AddLogging().AddMetrics().AddHttpClient("test");
211
var
builder = new ServiceCollection().AddLogging().AddMetrics().AddHttpClient("test");
273
IHttpClientBuilder
builder,
Microsoft.Extensions.ServiceDiscovery (4)
ServiceDiscoveryHttpClientBuilderExtensions.cs (4)
13
/// Extensions for configuring <see cref="
IHttpClientBuilder
"/> with service discovery.
18
/// Adds service discovery to the <see cref="
IHttpClientBuilder
"/>.
22
public static
IHttpClientBuilder
AddServiceDiscovery(this
IHttpClientBuilder
httpClientBuilder)