3 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)
Microsoft.Extensions.Http (1)
DefaultHttpClientFactory.cs (1)
103public HttpClient CreateClient(string name)
99 references to CreateClient
Aspire.Hosting (3)
ApplicationModel\HttpCommandOptions.cs (1)
24/// Gets or sets the name of the HTTP client to use when creating it via <see cref="IHttpClientFactory.CreateClient(string)"/>.
ExternalServiceBuilderExtensions.cs (1)
222() => serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(healthCheckKey)),
ResourceBuilderExtensions.cs (1)
2270var httpClient = context.ServiceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(commandOptions.HttpClientName ?? Options.DefaultName);
Aspire.Hosting.Azure (1)
AcrLoginService.cs (1)
90var httpClient = _httpClientFactory.CreateClient("AcrLogin");
Aspire.Hosting.GitHub.Models (1)
GitHubModelsExtensions.cs (1)
180var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient("GitHubModelsHealthCheck");
Aspire.Hosting.OpenAI (2)
OpenAIExtensions.cs (1)
220var 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");
HeaderPropagationSample (1)
Startup.cs (1)
76var client = clientFactory.CreateClient(clientName);
Microsoft.AspNetCore.HeaderPropagation.Tests (3)
HeaderPropagationIntegrationTest.cs (3)
45var client = context.RequestServices.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 89var client = serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 250var client = _httpClientFactory.CreateClient("example.com");
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 (13)
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 (3)
427var client = sp.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 477var outerClient = factory.CreateClient("outer"); 486var innerClient = factory.CreateClient("inner");
Microsoft.Extensions.Http.Polly.Tests (9)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (9)
55var client = factory.CreateClient("example.com"); 90var client = factory.CreateClient("example.com"); 128var client = factory.CreateClient("example.com"); 169var client = factory.CreateClient("example.com"); 213var client = factory.CreateClient("example.com"); 266var client = factory.CreateClient("example.com"); 311var client = factory.CreateClient("example.com"); 355var client = factory.CreateClient("Service"); 425var client = factory.CreateClient("example.com");
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");
WebFrontEnd (3)
Components_Pages_ExternalServices_razor.g.cs (3)
349var externalServiceClient = HttpClientFactory.CreateClient("external-service"); 353var nugetClient = HttpClientFactory.CreateClient("nuget"); 356var gatewayClient = HttpClientFactory.CreateClient("gateway");
Yarp.Frontend (1)
Program.cs (1)
20var client = httpClientFactory.CreateClient("gateway-client");