98 references to AddHttpClient
Aspire.Hosting (2)
ResourceBuilderExtensions.cs (2)
3921
/// instance with a specific handler, timeout, or other options using <see cref="HttpClientFactoryServiceCollectionExtensions.
AddHttpClient
(IServiceCollection, string)"/>.
4015
/// instance with a specific handler, timeout, or other options using <see cref="HttpClientFactoryServiceCollectionExtensions.
AddHttpClient
(IServiceCollection, string)"/>.
Aspire.Hosting.Azure (1)
Provisioning\AzureProvisionerExtensions.cs (1)
47
builder.Services.
AddHttpClient
("AcrLogin");
Aspire.Hosting.Azure.Tests (2)
AzureWebPubSubEmulatorTests.cs (2)
129
builder.Services.
AddHttpClient
(healthCheckKey).ConfigurePrimaryHttpMessageHandler(() => new EmulatorHealthHandler(statusCode));
143
builder.Services.
AddHttpClient
(healthCheckKey).ConfigurePrimaryHttpMessageHandler(() => new EmulatorHealthHandler(HttpStatusCode.OK));
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
166
builder.Services.
AddHttpClient
(string.Empty)
Aspire.Hosting.Tests (14)
WithHttpCommandTests.cs (14)
126
builder.Services.
AddHttpClient
(Options.DefaultName)
330
builder.Services.
AddHttpClient
(string.Empty)
445
builder.Services.
AddHttpClient
("commandclient")
471
builder.Services.
AddHttpClient
("commandclient")
502
builder.Services.
AddHttpClient
("commandclient")
607
builder.Services.
AddHttpClient
("commandclient")
651
builder.Services.
AddHttpClient
("commandclient")
695
builder.Services.
AddHttpClient
("commandclient")
738
builder.Services.
AddHttpClient
("commandclient")
805
builder.Services.
AddHttpClient
("commandclient")
831
builder.Services.
AddHttpClient
("commandclient")
858
builder.Services.
AddHttpClient
("commandclient")
886
builder.Services.
AddHttpClient
("commandclient")
913
builder.Services.
AddHttpClient
("commandclient")
Aspire.Keycloak.Authentication (2)
AspireKeycloakExtensions.cs (2)
86
builder.Services.
AddHttpClient
(KeycloakBackchannel);
168
builder.Services.
AddHttpClient
(KeycloakBackchannel);
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (8)
HttpClientFactory.cs (8)
24
.
AddHttpClient
(nameof(fileName))
47
.
AddHttpClient
(nameof(fileName))
70
.
AddHttpClient
(nameof(fileName))
97
.
AddHttpClient
(nameof(fileName))
120
.
AddHttpClient
(nameof(fileName))
143
.
AddHttpClient
(nameof(fileName))
164
.
AddHttpClient
(nameof(fileName))
174
.
AddHttpClient
(nameof(fileName))
Microsoft.Extensions.Http.Diagnostics.Tests (32)
Logging\AcceptanceTests.cs (12)
102
.
AddHttpClient
("testClient").Services
136
.
AddHttpClient
("namedClient1")
146
.
AddHttpClient
("namedClient2")
409
.
AddHttpClient
("test")
449
.
AddHttpClient
(FirstClientName)
456
.
AddHttpClient
(SecondClientName)
532
.
AddHttpClient
("testClient3")
538
.
AddHttpClient
("testClient4")
584
.
AddHttpClient
("test")
606
.
AddHttpClient
("test")
609
.
AddHttpClient
("normal")
662
.
AddHttpClient
(nameof(HttpClientLoggingHandler_LogsBodyDataUpToSpecifiedLimit))
Logging\HttpClientLoggingExtensionsTest.cs (20)
92
.
AddHttpClient
("test1")
95
.
AddHttpClient
("test2")
138
.
AddHttpClient
("")
141
.
AddHttpClient
("")
169
.
AddHttpClient
("test")
213
.
AddHttpClient
("test")
237
.
AddHttpClient
("test")
274
.
AddHttpClient
("test")
367
services.
AddHttpClient
("test")
398
.
AddHttpClient
("test")
420
.
AddHttpClient
("test")
443
.
AddHttpClient
("test")
557
.
AddHttpClient
(ClientName)
581
.
AddHttpClient
(ClientName)
659
.
AddHttpClient
("test")
706
.
AddHttpClient
("outer")
712
.
AddHttpClient
("inner")
781
.
AddHttpClient
("test")
801
.
AddHttpClient
("test")
828
.
AddHttpClient
("test")
Microsoft.Extensions.Http.Resilience.PerformanceTests (5)
HttpClientFactory.cs (1)
44
.
AddHttpClient
(StandardClient)
RetryBenchmark.cs (2)
39
.
AddHttpClient
("v8")
58
.
AddHttpClient
("v7")
StandardResilienceBenchmark.cs (2)
39
.
AddHttpClient
("v8")
60
.
AddHttpClient
("v7")
Microsoft.Extensions.Http.Resilience.Tests (31)
Hedging\HedgingTests.cs (1)
50
var httpClient = _services.
AddHttpClient
(ClientId);
Hedging\StandardHedgingTests.cs (1)
310
.
AddHttpClient
(ClientId)
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (12)
30
IHttpClientBuilder? builder = services.
AddHttpClient
("client");
48
IHttpClientBuilder? builder = services.
AddHttpClient
("client");
69
.
AddHttpClient
("client")
91
IHttpClientBuilder? builder = services.
AddHttpClient
("client");
121
.
AddHttpClient
("client")
171
IHttpClientBuilder? builder = services.
AddHttpClient
("client");
206
var builder = services.
AddHttpClient
("client");
255
var clientBuilder = services.
AddHttpClient
("client");
280
.
AddHttpClient
("my-client")
303
IHttpClientBuilder? builder = services.
AddHttpClient
("custom");
328
IHttpClientBuilder? builder = services.
AddHttpClient
("custom");
344
IHttpClientBuilder? builder = services.
AddHttpClient
("custom");
Resilience\HttpClientBuilderExtensionsTests.RetryBudget.cs (8)
33
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
59
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
75
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
91
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
110
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
127
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
140
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
221
.
AddHttpClient
(ClientName)
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (9)
31
_builder = new ServiceCollection().
AddHttpClient
(BuilderName);
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");
159
.
AddHttpClient
("test")
182
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
211
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test");
264
var builder = new ServiceCollection().AddLogging().AddMetrics().
AddHttpClient
("test").AddStandardResilienceHandler();