5 implementations of CreateClient
Aspire.Cli.Tests (2)
TestServices\TestHttpClientFactory.cs (1)
11public HttpClient CreateClient(string name)
Utils\MockHttpClientFactory.cs (1)
17public HttpClient CreateClient(string name)
Aspire.Hosting.Azure.Tests (2)
AcrLoginServiceTests.cs (1)
130public HttpClient CreateClient(string name) => new(handler, disposeHandler: false);
AzureSandboxesTests.cs (1)
3061public HttpClient CreateClient(string name)
Microsoft.Extensions.Http (1)
DefaultHttpClientFactory.cs (1)
103public HttpClient CreateClient(string name)
88 references to CreateClient
Aspire.Hosting (5)
ApplicationModel\HttpCommandOptions.cs (1)
50/// Gets or sets the name of the HTTP client to use when creating it via <see cref="IHttpClientFactory.CreateClient(string)"/>.
ExternalServiceBuilderExtensions.cs (2)
259() => serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(healthCheckKey)), 279() => serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(healthCheckKey)),
ResourceBuilderExtensions.cs (2)
2843() => serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(healthCheckKey)), 3716var httpClient = context.Services.GetRequiredService<IHttpClientFactory>().CreateClient(commandOptions.HttpClientName ?? Options.DefaultName);
Aspire.Hosting.Azure (1)
AcrLoginService.cs (1)
148var httpClient = _httpClientFactory.CreateClient("AcrLogin");
Aspire.Hosting.GitHub.Models (1)
GitHubModelsExtensions.cs (1)
224var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient("GitHubModelsHealthCheck");
Aspire.Hosting.OpenAI (2)
OpenAIExtensions.cs (1)
227var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient("OpenAIHealthCheck");
OpenAIHealthCheck.cs (1)
61: _httpClientFactory.CreateClient(_httpClientName);
Aspire.Keycloak.Authentication (2)
AspireKeycloakExtensions.cs (2)
92options.Backchannel = httpClientFactory.CreateClient(KeycloakBackchannel); 174options.Backchannel = httpClientFactory.CreateClient(KeycloakBackchannel);
DevTunnels.ApiService (1)
Program.cs (1)
14var http = httpClientFactory.CreateClient("frontend");
DotnetProject.WorkerService (1)
Program.cs (1)
17var client = factory.CreateClient("apiservice");
Microsoft.Extensions.Http (28)
DependencyInjection\HttpClientBuilderExtensions.cs (5)
385HttpClient httpClient = httpClientFactory.CreateClient(builder.Name); 449HttpClient httpClient = httpClientFactory.CreateClient(builder.Name); 493HttpClient httpClient = httpClientFactory.CreateClient(builder.Name); 542HttpClient httpClient = httpClientFactory.CreateClient(builder.Name); 659/// A named client resolved from DI as a keyed service will behave similarly to a client you would create with <see cref="IHttpClientFactory.CreateClient(string)"/>. This
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (20)
68return s.GetRequiredService<IHttpClientFactory>().CreateClient(string.Empty); 102/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 129/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 159/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 192/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 232/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 269/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 312/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 353/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 392/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 435/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 479/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 519/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 561/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 607/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 654/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 699/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 736/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 778/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name. 815/// <see cref="IHttpClientFactory.CreateClient(string)"/> and providing the matching name.
DependencyInjection\HttpClientKeyedLifetime.cs (1)
66return serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(name);
HttpClientFactoryExtensions.cs (1)
22return factory.CreateClient(Options.DefaultName);
IHttpClientFactory.cs (1)
27/// Each call to <see cref="CreateClient(string)"/> is guaranteed to return a new <see cref="HttpClient"/>
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (8)
HttpClientFactory.cs (8)
35.CreateClient(nameof(fileName)); 58.CreateClient(nameof(fileName)); 85.CreateClient(nameof(fileName)); 108.CreateClient(nameof(fileName)); 131.CreateClient(nameof(fileName)); 158.CreateClient(nameof(fileName)); 169.CreateClient(nameof(fileName)); 179.CreateClient(nameof(fileName));
Microsoft.Extensions.Http.Diagnostics.Tests (14)
Logging\AcceptanceTests.cs (10)
106using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient("testClient"); 159using var namedClient1 = provider.GetRequiredService<IHttpClientFactory>().CreateClient("namedClient1"); 160using var namedClient2 = provider.GetRequiredService<IHttpClientFactory>().CreateClient("namedClient2"); 419using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 467var firstClient = factory.CreateClient(FirstClientName); 468var secondClient = factory.CreateClient(SecondClientName); 590var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 616var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("normal"); 639var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 679.CreateClient(nameof(HttpClientLoggingHandler_LogsBodyDataUpToSpecifiedLimit));
Logging\HttpClientLoggingExtensionsTest.cs (4)
370using var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 669var client = sp.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 719var outerClient = factory.CreateClient("outer"); 728var innerClient = factory.CreateClient("inner");
Microsoft.Extensions.Http.Resilience.PerformanceTests (10)
HedgingBenchmark.cs (1)
25_client = factory.CreateClient(Type.ToString());
HttpResilienceBenchmark.cs (5)
38_client = factory.CreateClient(HttpClientFactory.EmptyClient); 39_standardClient = factory.CreateClient(HttpClientFactory.StandardClient); 40_singleHandlerClient = factory.CreateClient(HttpClientFactory.SingleHandlerClient); 41_hedgingClientNoRoutes = factory.CreateClient(nameof(HedgingClientType.NoRoutes)); 42_hedgingClientOrdered = factory.CreateClient(nameof(HedgingClientType.Ordered));
RetryBenchmark.cs (2)
64_v7 = factory.CreateClient("v7"); 65_v8 = factory.CreateClient("v8");
StandardResilienceBenchmark.cs (2)
66_v7 = factory.CreateClient("v7"); 67_v8 = factory.CreateClient("v8");
Microsoft.Extensions.Http.Resilience.Tests (12)
Hedging\HedgingTests.cs (1)
345return _serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(ClientId);
Hedging\StandardHedgingTests.cs (1)
337using var client = clientFactory.CreateClient(ClientId);
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (8)
80var client = serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient("client"); 133var client = clientBuilder.Services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient("client"); 230var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("client"); 265var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("client"); 287Assert.NotNull(factory.CreateClient("my-client")); 320serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient("custom"); 336serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient("custom"); 358serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient("custom");
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (2)
60return _serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(name); 266using var client = builder.Services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient("test");
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
62var client = services.GetRequiredService<IHttpClientFactory>().CreateClient("foo");
StandardService (1)
Program.cs (1)
15var client = httpClientFactory.CreateClient("functions");
Yarp.Frontend (1)
Program.cs (1)
20var client = httpClientFactory.CreateClient("gateway-client");