1 implementation of CreateClient
Microsoft.Extensions.Http (1)
DefaultHttpClientFactory.cs (1)
103public HttpClient CreateClient(string name)
81 references to CreateClient
Aspire.Keycloak.Authentication (2)
AspireKeycloakExtensions.cs (2)
89options.Backchannel = httpClientFactory.CreateClient(KeycloakBackchannel); 168options.Backchannel = httpClientFactory.CreateClient(KeycloakBackchannel);
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 (10)
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"); 677.CreateClient(nameof(HttpClientLoggingHandler_LogsBodyDataUpToSpecifiedLimit));
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 (9)
Hedging\HedgingTests.cs (1)
345return _serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient(ClientId);
Hedging\StandardHedgingTests.cs (1)
337using var client = clientFactory.CreateClient(ClientId);
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (5)
79var client = serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient("client"); 132var client = clientBuilder.Services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient("client"); 229var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("client"); 264var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("client"); 286Assert.NotNull(factory.CreateClient("my-client"));
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");