321 instantiations of HttpClient
Aspire.Dashboard.Tests (18)
Integration\FrontendBrowserTokenAuthTests.cs (5)
40using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 62using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 93using var client = new HttpClient { BaseAddress = new Uri($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}") }; 117using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 142using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") };
Integration\FrontendOpenIdConnectAuthTests.cs (2)
37using var client = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 82using var client = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}") };
Integration\IntegrationTestHelpers.cs (1)
133return new HttpClient(handler) { BaseAddress = new Uri(address) };
Integration\OtlpHttpServiceTests.cs (5)
228using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 256using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 281using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 310using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 339using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") };
Integration\ResponseCompressionTests.cs (2)
23using var client = new HttpClient(httpClientHandler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 45using var client = new HttpClient(httpClientHandler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") };
Integration\StartupTests.cs (3)
288using var httpClient = new HttpClient(new HttpClientHandler 395using var httpClient = new HttpClient() 690using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") };
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
188using var client = new HttpClient();
Aspire.Hosting.Tests (4)
DistributedApplicationTests.cs (4)
210using var clientB = new HttpClient(); 709using var client2 = new HttpClient(new SocketsHttpHandler 752using var client = new HttpClient(); 772using var client = new HttpClient();
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
183var httpClient = new HttpClient
Aspire.Seq (1)
SeqHealthCheck.cs (1)
14readonly HttpClient _client = new(new SocketsHttpHandler { ActivityHeadersPropagator = null }) { BaseAddress = new Uri(seqUri) };
Aspire.Workload.Tests (1)
StarterTemplateRunTestsBase.cs (1)
74using var httpClient = new HttpClient();
BasicTestApp (1)
Program.cs (1)
34builder.Services.AddSingleton(new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
BasicWebSite (1)
StartupWithoutEndpointRouting.cs (1)
66var client = new HttpClient();
dotnet-openapi (1)
Program.cs (1)
22using var httpClient = new HttpClientWrapper(new HttpClient());
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
293httpClient = new HttpClient(clientHandler);
GenerateRulesMissingDocumentation (1)
Program.cs (1)
34var httpClient = new HttpClient();
HostedBlazorWebassemblyApp.Client (1)
Program.cs (1)
24builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
HttpClientApp (1)
Program.cs (1)
16using var client = new HttpClient(handler);
HttpStress (1)
Program.cs (1)
525using (var client = new HttpClient(handler))
IIS.FunctionalTests (12)
Http2TrailersResetTests.cs (2)
508var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 517using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
Http3Tests.cs (1)
181return new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
131var client = new HttpClient(handler)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (3)
360using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 374using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 394using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
45var connection = new HttpClient()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Latin1Tests.cs (2)
46var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger)); 64var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
43using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) }; 57using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) };
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
45var connection = new HttpClient()
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1376var client = new HttpClient(handler)
IIS.Microbenchmarks (1)
PlaintextBenchmark.cs (1)
28_client = new HttpClient()
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
45var connection = new HttpClient()
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1376var client = new HttpClient(handler)
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
45var connection = new HttpClient()
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1376var client = new HttpClient(handler)
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
45var connection = new HttpClient()
IIS.Tests (1)
Utilities\TestServer.cs (1)
116HttpClient = new HttpClient(new LoggingHandler(new SocketsHttpHandler(), _loggerFactory.CreateLogger<TestServer>()))
IISExpress.FunctionalTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
131var client = new HttpClient(handler)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (3)
360using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 374using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 394using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
45var connection = new HttpClient()
src\Servers\IIS\IIS\test\Common.FunctionalTests\Latin1Tests.cs (2)
46var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger)); 64var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
43using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) }; 57using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1376var client = new HttpClient(handler)
Infrastructure.Common (3)
ServiceUtilHelper.cs (3)
542using (HttpClient httpClient = new HttpClient()) 554using (HttpClient httpClient = new HttpClient()) 566using (HttpClient httpClient = new HttpClient())
InMemory.FunctionalTests (7)
EventSourceTests.cs (1)
184using var httpClient = new HttpClient(socketsHandler);
Http2\Http2EndToEndTests.cs (1)
63using var httpClient = new HttpClient(socketsHandler);
KestrelMetricsTests.cs (5)
562using var httpClient = new HttpClient(socketsHandler); 642using var httpClient = new HttpClient(socketsHandler); 720using var httpClient = new HttpClient(socketsHandler); 800using var httpClient = new HttpClient(socketsHandler); 889using var httpClient = new HttpClient(socketsHandler);
installer.tasks (1)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
41using (var client = new HttpClient())
Interop.FunctionalTests (9)
Http2WebSocketInteropTests.cs (2)
141using var client = new HttpClient(pauseSendHandler); 170var client = new HttpClient(handler);
Http3\Http3RequestTests.cs (4)
1006using (var client = new HttpClient(httpClientHandler)) 1103using (var client = new HttpClient(httpClientHandler)) 1251using (var client = new HttpClient(httpClientHandler)) 1312using (var client = new HttpClient(httpClientHandler))
HttpClientHttp2InteropTests.cs (3)
1630using var client = new HttpClient(handler); 1675using var client = new HttpClient(handler); 1690var client = new HttpClient(handler);
JwtClientSample (1)
Program.cs (1)
84var httpResponse = await new HttpClient().GetAsync(ServerUrl + $"/generatetoken?user={userId}");
Microsoft.Arcade.Test.Common (1)
FakeHttpClient.cs (1)
16=> new HttpClient( // lgtm [cs/httpclient-checkcertrevlist-disabled] HttpClient used in unit tests
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerPostConfigureOptions.cs (1)
54options.Backchannel = new HttpClient(options.BackchannelHttpHandler ?? new HttpClientHandler());
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthPostConfigureOptions.cs (1)
38options.Backchannel = new HttpClient(options.BackchannelHttpHandler ?? new HttpClientHandler());
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectPostConfigureOptions.cs (1)
70options.Backchannel = new HttpClient(options.BackchannelHttpHandler ?? new HttpClientHandler());
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterPostConfigureOptions.cs (1)
48options.Backchannel = new HttpClient(options.BackchannelHttpHandler ?? new HttpClientHandler());
Microsoft.AspNetCore.Authentication.WsFederation (1)
WsFederationPostConfigureOptions.cs (1)
65options.Backchannel = new HttpClient(options.BackchannelHttpHandler ?? new HttpClientHandler());
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
TargetPickerUi.cs (1)
423using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
Microsoft.AspNetCore.HeaderPropagation.Tests (1)
HeaderPropagationMessageHandlerTest.cs (1)
27Client = new HttpClient(headerPropagationMessageHandler)
Microsoft.AspNetCore.Http.Connections.Client (1)
HttpConnection.cs (1)
633var httpClient = new HttpClient(httpMessageHandler);
Microsoft.AspNetCore.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
3255using (var client = new HttpClient()) 3318using (var client = new HttpClient(new HttpClientHandler() { CookieContainer = cookies })) 3417using (var client = new HttpClient())
Microsoft.AspNetCore.Identity.Test (1)
IdentityUIScriptsTest.cs (1)
23_httpClient = new HttpClient(new RetryHandler(new HttpClientHandler() { }, output, TimeSpan.FromSeconds(1), 5));
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
ComponentRenderingFunctionalTests.cs (1)
206services.AddSingleton(new WeatherForecastService(new HttpClient(loopHandler)
Microsoft.AspNetCore.Mvc.Testing (1)
WebApplicationFactory.cs (1)
496client = new HttpClient(handlers[0]);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (52)
AuthenticationTests.cs (1)
461using (HttpClient client = new HttpClient(handler))
DelegateTests.cs (2)
270using var client = new HttpClient(); 276using var client = new HttpClient();
Http2Tests.cs (2)
624using HttpClient client = new HttpClient(handler); 646using HttpClient client = new HttpClient(handler);
Http3Tests.cs (8)
41using var client = new HttpClient(handler); 71using var client = new HttpClient(handler); 111using var client = new HttpClient(handler); 145using var client = new HttpClient(handler); 173using var client = new HttpClient(handler); 203using var client = new HttpClient(handler); 228using var client = new HttpClient(handler); 252using var client = new HttpClient(handler);
HttpsTests.cs (2)
273using HttpClient client = new HttpClient(handler); 281using (HttpClient client = new HttpClient(handler))
Listener\AuthenticationOnExistingQueueTests.cs (1)
223using HttpClient client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(5) };
Listener\RequestBodyTests.cs (2)
177var client = new HttpClient(); 202using (HttpClient client = new HttpClient())
Listener\ResponseBodyTests.cs (5)
366using (var client = new HttpClient()) 406using (var client = new HttpClient()) 445using (var client = new HttpClient()) 479using (var client = new HttpClient()) 508using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout })
Listener\ResponseHeaderTests.cs (2)
20private HttpClient _client = new HttpClient(); 225using (var client = new HttpClient(handler))
Listener\ServerOnExistingQueueTests.cs (2)
320using HttpClient client = new HttpClient(); 326using HttpClient client = new HttpClient();
Listener\ServerTests.cs (3)
30using (var client = new HttpClient()) 59using (var client = new HttpClient()) 208using (HttpClient client = new HttpClient())
OpaqueUpgradeTests.cs (2)
295using var client = new HttpClient(); 371using (HttpClient client = new HttpClient())
RequestBodyLimitTests.cs (1)
412using (HttpClient client = new HttpClient())
RequestBodyTests.cs (1)
301using (HttpClient client = new HttpClient())
RequestHeaderTests.cs (2)
235HttpClient client = new HttpClient(); 246using (HttpClient client = new HttpClient())
RequestTests.cs (1)
619using (HttpClient client = new HttpClient())
ResponseBodyTests.cs (1)
439using (HttpClient client = new HttpClient())
ResponseCachingTests.cs (2)
471using (var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) }) 486using (var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) })
ResponseHeaderTests.cs (4)
129var httpClient = new HttpClient(socketsHttpHandler); 170using (HttpClient client = new HttpClient()) 197using (HttpClient client = new HttpClient()) 329using (HttpClient client = new HttpClient())
ResponseSendFileTests.cs (3)
612using (var client = new HttpClient()) 661using (var client = new HttpClient()) 681using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout })
ResponseTests.cs (1)
281using (var client = new HttpClient())
ResponseTrailersTests.cs (1)
363using HttpClient client = new HttpClient(handler);
ServerTests.cs (3)
369using (HttpClient client4 = new HttpClient()) 639using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout }) 647using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout })
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
DelegateOutOfProcTests.cs (1)
64using var client = new HttpClient();
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Common\DeploymentResult.cs (1)
65new HttpClient(new LoggingHandler(_loggerFactory, baseHandler))
Deployers\NginxDeployer.cs (1)
78using (var httpClient = new HttpClient())
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
IISDeploymentResult.cs (1)
39return new HttpClient(new LoggingHandler(messageHandler, Logger))
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (1)
WebHostTests.cs (1)
420return new HttpClient(httpHandler);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
HubConnectionTests.cs (2)
1478var httpResponse = await new HttpClient().GetAsync(server.Url + "/generateJwtToken"); 2695var httpResponse = await new HttpClient().GetAsync(server.Url + $"/generateJwtToken/{userName}");
Microsoft.AspNetCore.SignalR.Client.Tests (34)
HttpConnectionTests.ConnectionLifecycle.cs (5)
261using (var httpClient = new HttpClient(testHttpHandler)) 340var sse = new ServerSentEventsTransport(new HttpClient(httpHandler), loggerFactory: LoggerFactory); 366var sse = new ServerSentEventsTransport(new HttpClient(httpHandler), loggerFactory: LoggerFactory); 498var sse = new ServerSentEventsTransport(new HttpClient(httpHandler), loggerFactory: LoggerFactory); 524var lp = new LongPollingTransport(new HttpClient(httpHandler));
LongPollingTransportTests.cs (17)
44using (var httpClient = new HttpClient(mockHttpHandler.Object)) 77using (var httpClient = new HttpClient(mockHttpHandler.Object)) 135using (var httpClient = new HttpClient(mockHttpHandler.Object)) 166using (var httpClient = new HttpClient(mockHttpHandler.Object)) 199using (var httpClient = new HttpClient(mockHttpHandler.Object)) 257using (var httpClient = new HttpClient(mockHttpHandler.Object)) 298using (var httpClient = new HttpClient(mockHttpHandler.Object)) 344using (var httpClient = new HttpClient(mockHttpHandler.Object)) 376using (var httpClient = new HttpClient(mockHttpHandler.Object)) 427using (var httpClient = new HttpClient(mockHttpHandler.Object)) 492using (var httpClient = new HttpClient(mockHttpHandler.Object)) 565using (var httpClient = new HttpClient(mockHttpHandler.Object)) 594using (var httpClient = new HttpClient(mockHttpHandler.Object)) 623using (var httpClient = new HttpClient(mockHttpHandler.Object)) 662using (var httpClient = new HttpClient(mockHttpHandler.Object)) 685using (var httpClient = new HttpClient(handler)) 736using (var httpClient = new HttpClient(testHttpHandler))
SendUtilsTests.cs (1)
35using (var httpClient = new HttpClient(testHttpHandler))
ServerSentEventsTransportTests.cs (11)
49using (var httpClient = new HttpClient(mockHttpHandler.Object)) 94using (var httpClient = new HttpClient(mockHttpHandler.Object)) 147using (var httpClient = new HttpClient(mockHttpHandler.Object)) 203using (var httpClient = new HttpClient(mockHttpHandler.Object)) 253using (var httpClient = new HttpClient(mockHttpHandler.Object)) 280using (var httpClient = new HttpClient(mockHttpHandler.Object)) 334using (var httpClient = new HttpClient(mockHttpHandler.Object)) 369using (var httpClient = new HttpClient(mockHttpHandler.Object)) 396using (var httpClient = new HttpClient(mockHttpHandler.Object)) 428using (var httpClient = new HttpClient(testHttpHandler)) 481using (var httpClient = new HttpClient(mockHttpHandler.Object))
Microsoft.AspNetCore.SignalR.Tests (8)
DefaultTransportFactoryTests.cs (6)
24Assert.NotNull(new DefaultTransportFactory(transportType, new LoggerFactory(), new HttpClient(), httpConnectionOptions: null, accessTokenProvider: null)); 54var transportFactory = new DefaultTransportFactory(requestedTransport, loggerFactory: null, httpClient: new HttpClient(), httpConnectionOptions: null, accessTokenProvider: null); 67new DefaultTransportFactory(requestedTransport, loggerFactory: null, httpClient: new HttpClient(), httpConnectionOptions: null, accessTokenProvider: null); 79new DefaultTransportFactory(AllTransportTypes, loggerFactory: null, httpClient: new HttpClient(), httpConnectionOptions: null, accessTokenProvider: null) 91var transportFactory = new DefaultTransportFactory(requestedTransport, loggerFactory: null, httpClient: new HttpClient(), httpConnectionOptions: null, accessTokenProvider: null); 104new DefaultTransportFactory(requestedTransport, loggerFactory: null, httpClient: new HttpClient(), httpConnectionOptions: null, accessTokenProvider: null);
EndToEndTests.cs (2)
477using (var client = new HttpClient()) 651using (var client = new HttpClient())
Microsoft.AspNetCore.SpaProxy (1)
SpaProxyLaunchManager.cs (1)
96var httpClient = new HttpClient(new HttpClientHandler()
Microsoft.AspNetCore.SpaServices.Extensions (2)
AngularCli\AngularCliMiddleware.cs (1)
105using (var client = new HttpClient())
Proxying\SpaProxy.cs (1)
48return new HttpClient(handler)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaProxyTests.cs (1)
38return (context, new HttpClient(messageHandler.Object));
Microsoft.AspNetCore.StaticFiles.FunctionalTests (7)
FallbackStaticFileTest.cs (2)
57using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 106using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) })
StaticFileMiddlewareTests.cs (5)
36using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 81using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 106using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 156using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 198using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) })
Microsoft.AspNetCore.TestHost (1)
TestServer.cs (1)
177return new HttpClient(CreateHandler())
Microsoft.AspNetCore.TestHost.Tests (22)
ClientHandlerTests.cs (22)
40var httpClient = new HttpClient(handler); 66var httpClient = new HttpClient(handler); 91var httpClient = new HttpClient(handler); 105var httpClient = new HttpClient(handler); 120var httpClient = new HttpClient(handler); 138var httpClient = new HttpClient(handler); 155var httpClient = new HttpClient(handler); 172var httpClient = new HttpClient(handler); 189var httpClient = new HttpClient(handler); 273var httpClient = new HttpClient(handler); 288var httpClient = new HttpClient(handler); 378var httpClient = new HttpClient(handler); 392var httpClient = new HttpClient(handler); 413var httpClient = new HttpClient(handler); 432var httpClient = new HttpClient(handler); 450var httpClient = new HttpClient(handler); 472var httpClient = new HttpClient(handler); 515var httpClient = new HttpClient(handler); 531var httpClient = new HttpClient(handler); 551var httpClient = new HttpClient(handler); 567var httpClient = new HttpClient(handler); 592var httpClient = new HttpClient(handler);
Microsoft.AspNetCore.Testing (3)
ServiceFakesHostExtensions.cs (3)
49return new HttpClient(httpHandler) { BaseAddress = uri }; 52return new HttpClient { BaseAddress = uri }; 55return new HttpClient(handler) { BaseAddress = uri };
Microsoft.AspNetCore.WebSockets.Tests (7)
WebSocketCompressionMiddlewareTests.cs (3)
28using (var client = new HttpClient()) 56using (var client = new HttpClient()) 90using (var client = new HttpClient())
WebSocketMiddlewareTests.cs (4)
669using (var client = new HttpClient()) 703using (var client = new HttpClient()) 752using (var client = new HttpClient()) 825using (var client = new HttpClient())
Microsoft.Build.Tasks.Core (1)
DownloadFile.cs (1)
150using (var client = new HttpClient(HttpMessageHandler ?? new HttpClientHandler(), disposeHandler: true) { Timeout = TimeSpan.FromMilliseconds(Timeout) })
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
126using (var httpClient = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true }))
Microsoft.DotNet.Build.Tasks.Feed (6)
src\AzureDevOpsNugetFeedAssetPublisher.cs (1)
48_httpClient = new HttpClient(new HttpClientHandler {CheckCertificateRevocationList = true})
src\common\AzureStorageUtils.cs (1)
51private static readonly HttpClient s_httpClient = new HttpClient(
src\CreateAzureDevOpsFeed.cs (1)
132using (HttpClient client = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true })
src\PublishArtifactsInManifestBase.cs (3)
873var client = new HttpClient(handler) 1232using HttpClient httpClient = new HttpClient(new HttpClientHandler 1303using (HttpClient httpClient = new HttpClient(new HttpClientHandler
Microsoft.DotNet.Deployment.Tasks.Links (1)
Microsoft.DotNet.Git.IssueManager (1)
Clients\AzureDevOpsClient.cs (1)
52HttpClient client = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true })
Microsoft.DotNet.Helix.Sdk (3)
AzureDevOpsTask.cs (1)
56using (var client = new HttpClient(new HttpClientHandler
FindDotNetCliPackage.cs (1)
70_client = new HttpClient(_httpMessageHandler); // lgtm [cs/httpclient-checkcertrevlist-disabled] False positive; see above in ConfigureServices(); this is always created with CheckCertificateRevocationList = true
ProvisioningProfileProvider.cs (1)
241collection.TryAddSingleton(_ => new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true }));
Microsoft.DotNet.Internal.SymbolHelper (2)
SymbolPromotionHelper.cs (1)
33private static readonly HttpClient s_client = new();
SymbolUploadHelperFactory.cs (1)
24private static readonly HttpClient s_symbolDownloadClient = new();
Microsoft.DotNet.Open.Api.Tools.Tests (1)
OpenApiTestBase.cs (1)
80wrapper = new HttpClientWrapper(new HttpClient());
Microsoft.DotNet.SignTool (1)
src\VerifySignatures.cs (1)
30private static readonly HttpClient client = new(new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(10) });
Microsoft.DotNet.SwaggerGenerator.CmdLine (1)
Program.cs (1)
118using (var client = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true }))
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
GenerateSwaggerCode.cs (1)
98using (var client = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true }))
Microsoft.DotNet.VersionTools (1)
Util\X509Helper.cs (1)
13return new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true });
Microsoft.Extensions.Http (1)
DefaultHttpClientFactory.cs (1)
108var client = new HttpClient(handler, disposeHandler: false);
Microsoft.Extensions.Http.Diagnostics.Tests (14)
Logging\HttpClientLoggerTest.cs (14)
70using var client = new HttpClient(handler); 105using var client = new HttpClient(handler); 148using var httpClient = new HttpClient(handler); 237using var client = new HttpClient(handler); 333using var client = new HttpClient(handler); 435using var client = new HttpClient(handler); 550using var client = new HttpClient(handler); 643using var client = new HttpClient(handler); 686using var client = new HttpClient(handler); 729using var client = new HttpClient(handler); 767using var client = new HttpClient(handler); 811using var client = new HttpClient(handler); 917using var client = new HttpClient(handler); 956using var client = new HttpClient(handler);
Microsoft.Extensions.Logging.AzureAppServices (1)
BlobLoggerProvider.cs (1)
52_httpClient = new HttpClient();
Microsoft.Extensions.ML (2)
ModelLoaders\UriModelLoader.cs (2)
107using (var client = new HttpClient()) 141using (var client = new HttpClient())
Microsoft.ML.AutoML.Tests (1)
DatasetUtil.cs (1)
208using (var client = new HttpClient())
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
157using (var client = new HttpClient())
Microsoft.ML.PerformanceTests (1)
ImageClassificationBench.cs (1)
159using (HttpClient client = new HttpClient())
Microsoft.ML.Samples (5)
Dynamic\TensorFlow\ImageClassification.cs (1)
123using (HttpClient client = new HttpClient())
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
272using (HttpClient client = new HttpClient())
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
304using (HttpClient client = new HttpClient())
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
260using (HttpClient client = new HttpClient())
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
281using (HttpClient client = new HttpClient())
Microsoft.ML.Samples.GPU (5)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\ImageClassification.cs (1)
123using (HttpClient client = new HttpClient())
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
272using (HttpClient client = new HttpClient())
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
304using (HttpClient client = new HttpClient())
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
260using (HttpClient client = new HttpClient())
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
281using (HttpClient client = new HttpClient())
Microsoft.ML.SamplesUtils (1)
SamplesDatasetUtils.cs (1)
196using (HttpClient client = new HttpClient())
Microsoft.ML.Tokenizers.Data.Tests (1)
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (1)
17using (var client = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) })
Microsoft.ML.Tokenizers.Tests (2)
LlamaTests.cs (1)
21private static readonly HttpClient _httpClient = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) };
Utils.cs (1)
17using (var client = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) })
Negotiate.Client (2)
Controllers\AuthTestController.cs (2)
327return new HttpClient(new HttpClientHandler() 341return new HttpClient(new WinHttpHandler()
Sockets.FunctionalTests (7)
SocketTransportTests.cs (1)
51using var client = new HttpClient();
src\Servers\Kestrel\test\FunctionalTests\Http2\HandshakeTests.cs (1)
33Client = new HttpClient(new HttpClientHandler
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (1)
37Client = new HttpClient(handler)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
180using (var client = new HttpClient()) 1119using (var client = new HttpClient())
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (2)
76using (var client = new HttpClient()) 125using (var client = new HttpClient())
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1666client = new HttpClient(handler);
System.Private.Xml (1)
System\Xml\XmlDownloadManager.cs (1)
43using (var client = new HttpClient(handler))
Templates.Blazor.Tests (1)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()
Templates.Blazor.WebAssembly.Auth.Tests (2)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()
src\Shared\E2ETesting\SauceConnectServer.cs (1)
148var httpClient = new HttpClient
Templates.Blazor.WebAssembly.Tests (2)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()
src\Shared\E2ETesting\SauceConnectServer.cs (1)
148var httpClient = new HttpClient
Templates.Mvc.Tests (2)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()
src\Shared\E2ETesting\SauceConnectServer.cs (1)
148var httpClient = new HttpClient
Templates.Tests (2)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()
src\Shared\E2ETesting\SauceConnectServer.cs (1)
148var httpClient = new HttpClient
1763 references to HttpClient
Aspire.Dashboard.Tests (28)
Integration\FrontendBrowserTokenAuthTests.cs (5)
40using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 62using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 93using var client = new HttpClient { BaseAddress = new Uri($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}") }; 117using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 142using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") };
Integration\FrontendOpenIdConnectAuthTests.cs (2)
37using var client = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 82using var client = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}") };
Integration\IntegrationTestHelpers.cs (1)
112public static HttpClient CreateHttpClient(
Integration\OtlpCorsHttpServiceTests.cs (4)
28using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}"); 52using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}"); 93using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}"); 121using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}");
Integration\OtlpHttpServiceTests.cs (11)
39using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}"); 65using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}"); 111using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}"); 135using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}"); 163using var httpClient = IntegrationTestHelpers.CreateHttpClient($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}"); 197using var httpClient = IntegrationTestHelpers.CreateHttpClient($"https://{app.FrontendSingleEndPointAccessor().EndPoint}", 228using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 256using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 281using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 310using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 339using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") };
Integration\ResponseCompressionTests.cs (2)
23using var client = new HttpClient(httpClientHandler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 45using var client = new HttpClient(httpClientHandler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") };
Integration\StartupTests.cs (3)
288using var httpClient = new HttpClient(new HttpClientHandler 395using var httpClient = new HttpClient() 690using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") };
Aspire.EndToEnd.Tests (3)
tests\Shared\WorkloadTesting\AspireProject.cs (2)
24public static Lazy<HttpClient> Client => new(CreateHttpClient); 453private static HttpClient CreateHttpClient()
tests\Shared\WorkloadTesting\ProjectInfo.cs (1)
13public HttpClient Client { get; set; } = default!;
Aspire.Hosting.Containers.Tests (6)
WithDockerfileTests.cs (6)
41using var client = app.CreateHttpClient("testcontainer", "http"); 73using var client = app.CreateHttpClient("testcontainer", "http"); 105using var client = app.CreateHttpClient("testcontainer", "http"); 138using var client = app.CreateHttpClient("testcontainer", "http"); 365using var client = app.CreateHttpClient("testcontainer", "http"); 435using var client = app.CreateHttpClient("testcontainer", "http");
Aspire.Hosting.NodeJs.Tests (3)
NodeAppFixture.cs (1)
112using var client = App.CreateHttpClient(NodeAppBuilder!.Resource.Name, endpointName: "http");
NodeFunctionalTests.cs (2)
25using var nodeClient = _nodeJsFixture.App.CreateHttpClient(_nodeJsFixture.NodeAppBuilder!.Resource.Name, "http"); 37using var npmClient = _nodeJsFixture.App.CreateHttpClient(_nodeJsFixture.NpmAppBuilder!.Resource.Name, "http");
Aspire.Hosting.PostgreSQL.Tests (2)
PostgresFunctionalTests.cs (2)
92var client = app.CreateHttpClient(adminBuilder.Resource.Name, "http"); 169var client = app.CreateHttpClient(pgWebBuilder.Resource.Name, "http");
Aspire.Hosting.Redis (2)
RedisBuilderExtensions.cs (2)
188using var client = new HttpClient(); 202static async Task ImportRedisDatabases(ILogger resourceLogger, IEnumerable<RedisResource> redisInstances, HttpClient client, CancellationToken cancellationToken)
Aspire.Hosting.Redis.Tests (8)
RedisFunctionalTests.cs (8)
81var client = app.CreateHttpClient(commanderBuilder.Resource.Name, "http"); 169using var client1 = app1.CreateHttpClient($"{redis1.Resource.Name}-insight", "http"); 206using var client2 = app2.CreateHttpClient($"{redisInsightBuilder.Resource.Name}", "http"); 258var client = app.CreateHttpClient(redisInsightBuilder.Resource.Name, "http"); 589var httpClient = app.CreateHttpClient(redisInsightBuilder1.Resource.Name, "http"); 632var httpClient = app.CreateHttpClient(redisInsightBuilder2.Resource.Name, "http"); 663private static async Task EnsureRedisInsightEulaAccepted(HttpClient httpClient, CancellationToken ct) 681static async Task AcceptRedisInsightEula(HttpClient client, CancellationToken ct)
Aspire.Hosting.Testing (7)
DistributedApplicationFactory.cs (3)
69/// Creates an instance of <see cref="HttpClient"/> that is configured to route requests to the specified resource and endpoint. 71/// <returns>The <see cref="HttpClient"/>.</returns> 72public HttpClient CreateHttpClient(string resourceName, string? endpointName = default)
DistributedApplicationHostingTestingExtensions.cs (4)
17/// Creates an <see cref="HttpClient"/> configured to communicate with the specified resource. 22/// <returns>The <see cref="HttpClient"/>.</returns> 23public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, string? endpointName = default) 27var client = clientFactory.CreateClient();
Aspire.Hosting.Testing.Tests (6)
DistributedApplicationHttpClientExtensionsForTests.cs (2)
11public static HttpClient CreateHttpClientWithResilience(this DistributedApplication app, string resourceName, string? endpointName = default) 14var client = s_httpClientFactory.Value.CreateClient();
TestingBuilderTests.cs (2)
160var httpClient = app.CreateHttpClientWithResilience("mywebapp1"); 213var httpClient = app.CreateHttpClient("mywebapp1", "https");
TestingFactoryTests.cs (2)
50var httpClient = _app.CreateHttpClientWithResilience("mywebapp1"); 79var httpClient = _app.CreateHttpClientWithResilience("mywebapp1", "https");
Aspire.Hosting.Tests (16)
DistributedApplicationTests.cs (8)
197using var clientA = app.CreateHttpClient(testProgram.ServiceABuilder.Resource.Name, "http"); 198using var clientC = app.CreateHttpClient(testProgram.ServiceCBuilder.Resource.Name, "http"); 210using var clientB = new HttpClient(); 701var client = app.CreateHttpClientWithResilience("servicea", "http"); 709using var client2 = new HttpClient(new SocketsHttpHandler 752using var client = new HttpClient(); 772using var client = new HttpClient(); 812using var clientA = app.CreateHttpClient(servicea.Resource.Name, "http");
SlimTestProgramTests.cs (3)
34using var clientA = app.CreateHttpClient(testProgram.ServiceABuilder.Resource.Name, "http"); 37using var clientB = app.CreateHttpClient(testProgram.ServiceBBuilder.Resource.Name, "http"); 40using var clientC = app.CreateHttpClient(testProgram.ServiceCBuilder.Resource.Name, "http");
TestProgramFixture.cs (3)
69using var clientA = App.CreateHttpClient(TestProgram.ServiceABuilder.Resource.Name, "http"); 73using var clientB = App.CreateHttpClient(TestProgram.ServiceBBuilder.Resource.Name, "http"); 77using var clientC = App.CreateHttpClient(TestProgram.ServiceCBuilder.Resource.Name, "http");
tests\Aspire.Hosting.Testing.Tests\DistributedApplicationHttpClientExtensionsForTests.cs (2)
11public static HttpClient CreateHttpClientWithResilience(this DistributedApplication app, string resourceName, string? endpointName = default) 14var client = s_httpClientFactory.Value.CreateClient();
Aspire.Playground.Tests (14)
AppHostTests.cs (3)
97using var client = CreateHttpClientWithResilience(app, resource); 123public static HttpClient CreateHttpClientWithResilience(DistributedApplication app, string resource) 266using var client = CreateHttpClientWithResilience(app, "api");
Infrastructure\DistributedApplicationExtensions.cs (10)
167/// Creates an <see cref="HttpClient"/> configured to communicate with the specified resource. 169public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, bool useHttpClientFactory) 173/// Creates an <see cref="HttpClient"/> configured to communicate with the specified resource. 175public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, string? endpointName, bool useHttpClientFactory) 183var httpClient = new HttpClient 192/// Creates an <see cref="HttpClient"/> configured to communicate with the specified resource with custom configuration. 194public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, string? endpointName, Action<IHttpClientBuilder> configure) 202var httpClient = httpClientFactory.CreateClient(); 218using (var checkHttpClient = app.CreateHttpClient(project.Name)) 246using var applyMigrationsHttpClient = app.CreateHttpClient(project.Name, useHttpClientFactory: false);
ProjectSpecificTests.cs (1)
88using var apiServiceClient = AppHostTests.CreateHttpClientWithResilience(app, "apiservice");
Aspire.Seq (1)
SeqHealthCheck.cs (1)
14readonly HttpClient _client = new(new SocketsHttpHandler { ActivityHeadersPropagator = null }) { BaseAddress = new Uri(seqUri) };
Aspire.Workload.Tests (4)
StarterTemplateRunTestsBase.cs (1)
74using var httpClient = new HttpClient();
tests\Shared\WorkloadTesting\AspireProject.cs (2)
24public static Lazy<HttpClient> Client => new(CreateHttpClient); 453private static HttpClient CreateHttpClient()
tests\Shared\WorkloadTesting\ProjectInfo.cs (1)
13public HttpClient Client { get; set; } = default!;
AuthSamples.FunctionalTests (11)
ClaimsTransformTests.cs (1)
19public HttpClient Client { get; }
CookiesTests.cs (1)
18public HttpClient Client { get; }
CustomAuthorizationFailureResponseTests.cs (1)
14private HttpClient Client { get; }
CustomPolicyProviderTests.cs (2)
22public HttpClient Client { get; } 121internal static async Task<HttpResponseMessage> SignIn(HttpClient client, string userName, string dob)
DynamicSchemeTests.cs (1)
20public HttpClient Client { get; }
HttpClientExtensions.cs (2)
17this HttpClient client, 29this HttpClient client,
IdentityExternalClaimsTests.cs (1)
19public HttpClient Client { get; }
PathSchemeSelectionTests.cs (1)
20public HttpClient Client { get; }
StaticFilesAuthTests.cs (1)
19public HttpClient Client { get; }
AzureFunctionsEndToEnd.ApiService (1)
Program.cs (1)
69app.MapGet("/", async (HttpClient client) =>
BasicTestApp (2)
AuthTest\ServerAuthenticationStateProvider.cs (2)
15private readonly HttpClient _httpClient; 17public ServerAuthenticationStateProvider(HttpClient httpClient)
BasicWebSite (3)
Services\WeatherForecastService.cs (2)
12private readonly HttpClient _httpClient; 14public WeatherForecastService(HttpClient httpClient)
StartupWithoutEndpointRouting.cs (1)
66var client = new HttpClient();
Diagnostics.EFCore.FunctionalTests (1)
DatabaseErrorPageMiddlewareTest.cs (1)
279var client = server.CreateClient();
Diagnostics.FunctionalTests (8)
DatabaseErrorPageSampleTest.cs (1)
17public HttpClient Client { get; }
DeveloperExceptionPageSampleTest.cs (1)
20public HttpClient Client { get; }
ExceptionHandlerSampleTest.cs (1)
16public HttpClient Client { get; }
MiddlewareAnalysisSampleTest.cs (1)
16public HttpClient Client { get; }
ProblemDetailsExceptionHandlerSampleTest.cs (1)
20public HttpClient Client { get; }
StatusCodeSampleTest.cs (1)
21public HttpClient Client { get; }
TestFixture.cs (1)
40public HttpClient Client { get; }
WelcomePageSampleTest.cs (1)
16public HttpClient Client { get; }
dotnet-openapi (2)
HttpClientWrapper.cs (2)
17private readonly HttpClient _client; 19public HttpClientWrapper(HttpClient client)
dotnet-svcutil-lib (12)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (10)
39private HttpClient _httpClient; 41private volatile MruCache<string, HttpClient> _httpClientCache; 229internal async Task<HttpClient> GetHttpClientAsync(EndpointAddress to, SecurityTokenProviderContainer tokenProvider, 241internal HttpClient GetHttpClient(EndpointAddress to, NetworkCredential credential, 251_httpClientCache = new MruCache<string, HttpClient>(10); 256HttpClient httpClient; 519var httpClientToDispose = _httpClient; 816internal virtual Task<HttpClient> GetHttpClientAsync(EndpointAddress to, Uri via, TimeoutHelper timeoutHelper) 821protected async Task<HttpClient> GetHttpClientAsync(EndpointAddress to, Uri via, SecurityTokenContainer clientCertificateToken, TimeoutHelper timeoutHelper) 883private HttpClient _httpClient;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpsChannelFactory.cs (2)
316internal override async Task<HttpClient> GetHttpClientAsync(EndpointAddress to, Uri via, TimeoutHelper timeoutHelper) 319HttpClient httpClient = await base.GetHttpClientAsync(to, via, clientCertificateToken, timeoutHelper);
GenerateRulesMissingDocumentation (1)
Program.cs (1)
34var httpClient = new HttpClient();
HeaderPropagationSample (1)
Startup.cs (1)
76var client = clientFactory.CreateClient(clientName);
HostedBlazorWebassemblyApp.Client (2)
Data\HttpWeatherForecastService.cs (2)
16public HttpWeatherForecastService(HttpClient client) 21public HttpClient Client { get; }
HttpClientApp (1)
Program.cs (1)
16using var client = new HttpClient(handler);
HttpStress (3)
Program.cs (3)
525using (var client = new HttpClient(handler)) 634public ClientContext(HttpClient httpClient, int taskNum, int seed) 649public HttpClient HttpClient { get; }
IIS.FunctionalTests (30)
Http2TrailersResetTests.cs (6)
236var client = CreateClient(); 297var client = CreateClient(); 321var client = CreateClient(); 503private static HttpClient CreateClient() 508var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 517using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
Http3Tests.cs (9)
47using var client = SetUpClient(); 63using var client = SetUpClient(); 87using var client = SetUpClient(); 106using var client = SetUpClient(); 120using var client = SetUpClient(); 133using var client = SetUpClient(); 149using var client = SetUpClient(); 166using var client = SetUpClient(); 176private HttpClient SetUpClient()
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
131var client = new HttpClient(handler)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (3)
360using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 374using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 394using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (1)
88var client = deploymentResult.CreateClient(handler);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (4)
41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 45var connection = new HttpClient() 105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
60public HttpClient Client => DeploymentResult.HttpClient;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Latin1Tests.cs (2)
46var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger)); 64var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
43using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) }; 57using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\WindowsAuthTests.cs (1)
54var client = deploymentResult.CreateClient(new HttpClientHandler { UseDefaultCredentials = true });
IIS.LongTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (4)
41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 45var connection = new HttpClient() 105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
60public HttpClient Client => DeploymentResult.HttpClient;
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (5)
1319var client = CreateNonValidatingClient(deploymentResult); 1342var client = CreateNonValidatingClient(deploymentResult); 1376var client = new HttpClient(handler) 1419var client = CreateNonValidatingClient(deploymentResult); 1469private static HttpClient CreateNonValidatingClient(IISDeploymentResult deploymentResult)
IIS.Microbenchmarks (2)
PlaintextBenchmark.cs (1)
21private HttpClient _client;
StartupTimeBenchmark.cs (1)
18public HttpClient _client;
IIS.NewHandler.FunctionalTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (4)
41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 45var connection = new HttpClient() 105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
60public HttpClient Client => DeploymentResult.HttpClient;
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (5)
1319var client = CreateNonValidatingClient(deploymentResult); 1342var client = CreateNonValidatingClient(deploymentResult); 1376var client = new HttpClient(handler) 1419var client = CreateNonValidatingClient(deploymentResult); 1469private static HttpClient CreateNonValidatingClient(IISDeploymentResult deploymentResult)
IIS.NewShim.FunctionalTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (4)
41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 45var connection = new HttpClient() 105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
60public HttpClient Client => DeploymentResult.HttpClient;
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (5)
1319var client = CreateNonValidatingClient(deploymentResult); 1342var client = CreateNonValidatingClient(deploymentResult); 1376var client = new HttpClient(handler) 1419var client = CreateNonValidatingClient(deploymentResult); 1469private static HttpClient CreateNonValidatingClient(IISDeploymentResult deploymentResult)
IIS.ShadowCopy.Tests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (4)
41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 45var connection = new HttpClient() 105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
60public HttpClient Client => DeploymentResult.HttpClient;
IIS.Tests (1)
Utilities\TestServer.cs (1)
52public HttpClient HttpClient { get; private set; }
IISExpress.FunctionalTests (22)
InProcess\AuthenticationTests.cs (1)
55var httpClient = deploymentResult.CreateHttpClient(httpClientHandler);
OutOfProcess\NtlmAuthentationTest.cs (1)
51var httpClient = result.HttpClient;
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
131var client = new HttpClient(handler)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (3)
360using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 374using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) }; 394using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (1)
88var client = deploymentResult.CreateClient(handler);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (4)
41public static async Task StressLoad(HttpClient httpClient, string path, Action<HttpResponseMessage> action) 45var connection = new HttpClient() 105public static Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, bool> predicate) 110public static async Task<HttpResponseMessage> RetryRequestAsync(this HttpClient client, string uri, Func<HttpResponseMessage, Task<bool>> predicate)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISTestSiteFixture.cs (1)
60public HttpClient Client => DeploymentResult.HttpClient;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Latin1Tests.cs (2)
46var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger)); 64var client = new HttpClient(new LoggingHandler(new WinHttpHandler() { SendTimeout = TimeSpan.FromMinutes(3) }, deploymentResult.Logger));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
43using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) }; 57using var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(200) };
src\Servers\IIS\IIS\test\Common.FunctionalTests\WindowsAuthTests.cs (1)
54var client = deploymentResult.CreateClient(new HttpClientHandler { UseDefaultCredentials = true });
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (5)
1319var client = CreateNonValidatingClient(deploymentResult); 1342var client = CreateNonValidatingClient(deploymentResult); 1376var client = new HttpClient(handler) 1419var client = CreateNonValidatingClient(deploymentResult); 1469private static HttpClient CreateNonValidatingClient(IISDeploymentResult deploymentResult)
Infrastructure.Common (3)
ServiceUtilHelper.cs (3)
542using (HttpClient httpClient = new HttpClient()) 554using (HttpClient httpClient = new HttpClient()) 566using (HttpClient httpClient = new HttpClient())
InMemory.FunctionalTests (7)
EventSourceTests.cs (1)
184using var httpClient = new HttpClient(socketsHandler);
Http2\Http2EndToEndTests.cs (1)
63using var httpClient = new HttpClient(socketsHandler);
KestrelMetricsTests.cs (5)
562using var httpClient = new HttpClient(socketsHandler); 642using var httpClient = new HttpClient(socketsHandler); 720using var httpClient = new HttpClient(socketsHandler); 800using var httpClient = new HttpClient(socketsHandler); 889using var httpClient = new HttpClient(socketsHandler);
installer.tasks (2)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (2)
41using (var client = new HttpClient()) 49public async Task ExecuteAsync(HttpClient client)
Interop.FunctionalTests (45)
Http2WebSocketInteropTests.cs (4)
78using var client = CreateClient(); 141using var client = new HttpClient(pauseSendHandler); 166private static HttpClient CreateClient() 170var client = new HttpClient(handler);
Http3\Http3RequestTests.cs (4)
1006using (var client = new HttpClient(httpClientHandler)) 1103using (var client = new HttpClient(httpClientHandler)) 1251using (var client = new HttpClient(httpClientHandler)) 1312using (var client = new HttpClient(httpClientHandler))
HttpClientHttp2InteropTests.cs (37)
63using var client = CreateClient(); 88using var client = CreateClient(); 127using var client = CreateClient(); 174using var client = CreateClient(); 294using var client = CreateClient(); 371using var client = CreateClient(); 430using var client = CreateClient(); 534using var client = CreateClient(); 566using var client = CreateClient(); 598using var client = CreateClient(); 624using var client = CreateClient(); 652using var client = CreateClient(); 681using var client = CreateClient(); 729using var client = CreateClient(); 788using var client = CreateClient(); 838using var client = CreateClient(); 885using var client = CreateClient(); 929using var client = CreateClient(); 970using var client = CreateClient(); 1011using var client = CreateClient(); 1054using var client = CreateClient(); 1107using var client = CreateClient(); 1163using var client = CreateClient(); 1224using var client = CreateClient(); 1285using var client = CreateClient(); 1325using var client = CreateClient(); 1359using var client = CreateClient(); 1400using var client = CreateClient(); 1430using var client = CreateClient(); 1479using var client = CreateClient(); 1514using var client = CreateClient(); 1565using var client = CreateClient(); 1588using var client = CreateClient(); 1630using var client = new HttpClient(handler); 1675using var client = new HttpClient(handler); 1686private static HttpClient CreateClient() 1690var client = new HttpClient(handler);
Keycloak.Web (1)
WeatherApiClient.cs (1)
3public class WeatherApiClient(HttpClient httpClient)
Microsoft.Arcade.Test.Common (1)
FakeHttpClient.cs (1)
15public static HttpClient WithResponses(params HttpResponseMessage[] responses)
Microsoft.AspNetCore.Authentication (1)
RemoteAuthenticationOptions.cs (1)
77public HttpClient Backchannel { get; set; } = default!;
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerOptions.cs (1)
88public HttpClient Backchannel { get; set; } = default!;
Microsoft.AspNetCore.Authentication.OAuth (4)
Events\OAuthCreatingTicketContext.cs (2)
34HttpClient backchannel, 95public HttpClient Backchannel { get; }
OAuthHandler.cs (2)
26/// Gets the <see cref="HttpClient"/> instance used to communicate with the remote authentication provider. 28protected HttpClient Backchannel => Options.Backchannel;
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
Events\AuthorizationCodeReceivedContext.cs (1)
44public HttpClient Backchannel { get; internal set; } = default!;
OpenIdConnectHandler.cs (2)
38/// Gets the <see cref="HttpClient"/> used to communicate with the remote identity provider. 40protected HttpClient Backchannel => Options.Backchannel;
Microsoft.AspNetCore.Authentication.Test (45)
CertificateTests.cs (4)
394var client = server.CreateClient(); 411var client = server.CreateClient(); 430var client = server.CreateClient(); 448var client = server.CreateClient();
OpenIdConnect\OpenIdConnectEventTests.cs (9)
966var client = server.CreateClient(); 993var client = server.CreateClient(); 1010var client = server.CreateClient(); 1036var client = server.CreateClient(); 1062var client = server.CreateClient(); 1079var client = server.CreateClient(); 1102var client = server.CreateClient(); 1129var client = server.CreateClient(); 1310var client = server.CreateClient();
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (9)
966var client = server.CreateClient(); 993var client = server.CreateClient(); 1010var client = server.CreateClient(); 1036var client = server.CreateClient(); 1062var client = server.CreateClient(); 1079var client = server.CreateClient(); 1102var client = server.CreateClient(); 1129var client = server.CreateClient(); 1308var client = server.CreateClient();
TwitterTests.cs (3)
220var client = server.CreateClient(); 270var client = server.CreateClient(); 377var client = server.CreateClient();
WsFederation\WsFederationTest.cs (10)
62var httpClient = server.CreateClient(); 72var httpClient = await CreateClient(); 88var httpClient = await CreateClient(); 104var httpClient = await CreateClient(); 120var httpClient = await CreateClient(); 144var httpClient = await CreateClient(); 153var httpClient = await CreateClient(allowUnsolicited: true); 171var httpClient = await CreateClient(); 189var httpClient = await CreateClient(); 274private async Task<HttpClient> CreateClient(bool allowUnsolicited = false)
WsFederation\WsFederationTest_Handler.cs (10)
60var httpClient = server.CreateClient(); 70var httpClient = await CreateClient(); 86var httpClient = await CreateClient(); 102var httpClient = await CreateClient(); 118var httpClient = await CreateClient(); 142var httpClient = await CreateClient(); 151var httpClient = await CreateClient(allowUnsolicited: true); 169var httpClient = await CreateClient(); 187var httpClient = await CreateClient(); 272private async Task<HttpClient> CreateClient(bool allowUnsolicited = false)
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterHandler.cs (1)
25private HttpClient Backchannel => Options.Backchannel;
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
TargetPickerUi.cs (1)
423using var httpClient = new HttpClient { Timeout = TimeSpan.FromSeconds(5) };
Microsoft.AspNetCore.Components.WebViewE2E.Test (1)
BasicBlazorHybridTest.cs (1)
42serviceCollection.AddSingleton<HttpClient>();
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (31)
HealthCheckEndpointRouteBuilderExtensionsTest.cs (2)
74var client = server.CreateClient(); 119var client = server.CreateClient();
HealthCheckMiddlewareSampleTest.cs (4)
27var client = server.CreateClient(); 49var client = server.CreateClient(); 72var client = server.CreateClient(); 94var client = server.CreateClient();
HealthCheckMiddlewareTests.cs (25)
63var client = server.CreateClient(); 90var client = server.CreateClient(); 117var client = server.CreateClient(); 147var client = server.CreateClient(); 180var client = server.CreateClient(); 213var client = server.CreateClient(); 246var client = server.CreateClient(); 279var client = server.CreateClient(); 325var client = server.CreateClient(); 362var client = server.CreateClient(); 397var client = server.CreateClient(); 426var client = server.CreateClient(); 461var client = server.CreateClient(); 500var client = server.CreateClient(); 530var client = server.CreateClient(); 560var client = server.CreateClient(); 588var client = server.CreateClient(); 618var client = server.CreateClient(); 653var client = server.CreateClient(); 690var client = server.CreateClient(); 728var client = server.CreateClient(); 766var client = server.CreateClient(); 804var client = server.CreateClient(); 846var client = server.CreateClient(); 890var client = server.CreateClient();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (4)
Logging\AcceptanceTests.cs (3)
99private static Task RunAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func) 105Func<FakeLogCollector, HttpClient, IServiceProvider, Task> func) 129using var client = host.GetTestClient();
Logging\AcceptanceTests.Mvc.cs (1)
51private static Task RunControllerAsync(LogLevel level, Action<IServiceCollection> configure, Func<FakeLogCollector, HttpClient, Task> func)
Microsoft.AspNetCore.Diagnostics.Tests (26)
DeveloperExceptionPageMiddlewareTest.cs (2)
253var client = server.CreateClient(); 328var client = server.CreateClient();
ExceptionHandlerTest.cs (16)
60var client = server.CreateClient(); 115var client = server.CreateClient(); 181var client = server.CreateClient(); 237var client = server.CreateClient(); 292var client = server.CreateClient(); 364var client = server.CreateClient(); 434var client = server.CreateClient(); 598var client = server.CreateClient(); 647var client = server.CreateClient(); 688var client = server.CreateClient(); 727var client = server.CreateClient(); 768var client = server.CreateClient(); 819var client = server.CreateClient(); 873var client = server.CreateClient(); 925var client = server.CreateClient(); 983var client = server.CreateClient();
StatusCodeMiddlewareTest.cs (8)
60var client = server.CreateClient(); 126var client = server.CreateClient(); 188var client = server.CreateClient(); 243var client = server.CreateClient(); 277var client = server.CreateClient(); 311var client = server.CreateClient(); 348var client = server.CreateClient(); 386var client = server.CreateClient();
Microsoft.AspNetCore.HeaderPropagation (7)
DependencyInjection\HeaderPropagationApplicationBuilderExtensions.cs (2)
12/// <see cref="IApplicationBuilder"/> extension methods for <see cref="HeaderPropagationMiddleware"/> which propagates request headers to an <see cref="HttpClient"/>. 23/// Adds a middleware that collect headers to be propagated to a <see cref="HttpClient"/>.
DependencyInjection\HeaderPropagationHttpClientBuilderExtensions.cs (1)
10/// <see cref="IHttpClientBuilder"/> extension methods for <see cref="HeaderPropagationMiddleware"/> which propagates request headers to an <see cref="System.Net.Http.HttpClient"/>.
DependencyInjection\HeaderPropagationServiceCollectionExtensions.cs (3)
11/// <see cref="IServiceCollection"/> extension methods for <see cref="HeaderPropagationMiddleware"/> which propagates request headers to an <see cref="System.Net.Http.HttpClient"/>. 16/// Adds services required for propagating headers to a <see cref="HttpClient"/>. 30/// Adds services required for propagating headers to a <see cref="HttpClient"/>.
HeaderPropagationMiddleware.cs (1)
12/// A Middleware for propagating headers to an <see cref="HttpClient"/>.
Microsoft.AspNetCore.HeaderPropagation.Tests (8)
HeaderPropagationIntegrationTest.cs (7)
45var client = context.RequestServices.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 59var client = server.CreateClient(); 89var client = serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient("test"); 107var client = server.CreateClient(); 133var client = server.CreateClient(); 180var client = server.CreateClient(); 250var client = _httpClientFactory.CreateClient("example.com");
HeaderPropagationMessageHandlerTest.cs (1)
36public HttpClient Client { get; set; }
Microsoft.AspNetCore.Http.Connections.Client (13)
HttpConnection.cs (4)
45private readonly HttpClient? _httpClient; 445private async Task<NegotiationResponse> NegotiateAsync(Uri url, HttpClient httpClient, ILogger logger, CancellationToken cancellationToken) 553private HttpClient CreateHttpClient() 633var httpClient = new HttpClient(httpMessageHandler);
Internal\DefaultTransportFactory.cs (2)
13private readonly HttpClient? _httpClient; 20public DefaultTransportFactory(HttpTransportType requestedTransportType, ILoggerFactory loggerFactory, HttpClient? httpClient, HttpConnectionOptions httpConnectionOptions, Func<Task<string?>> accessTokenProvider)
Internal\LongPollingTransport.cs (2)
20private readonly HttpClient _httpClient; 36public LongPollingTransport(HttpClient httpClient, HttpConnectionOptions? httpConnectionOptions = null, ILoggerFactory? loggerFactory = null)
Internal\SendUtils.cs (1)
19public static async Task SendMessages(Uri sendUrl, IDuplexPipe application, HttpClient httpClient, ILogger logger, CancellationToken cancellationToken = default)
Internal\ServerSentEventsTransport.cs (2)
21private readonly HttpClient _httpClient; 37public ServerSentEventsTransport(HttpClient httpClient, HttpConnectionOptions? httpConnectionOptions = null, ILoggerFactory? loggerFactory = null)
Internal\WebSocketsTransport.cs (2)
39private readonly HttpClient? _httpClient; 74public WebSocketsTransport(HttpConnectionOptions httpConnectionOptions, ILoggerFactory loggerFactory, Func<Task<string?>> accessTokenProvider, HttpClient? httpClient,
Microsoft.AspNetCore.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
3255using (var client = new HttpClient()) 3318using (var client = new HttpClient(new HttpClientHandler() { CookieContainer = cookies })) 3417using (var client = new HttpClient())
Microsoft.AspNetCore.Http.Extensions.Tests (2)
HttpResponseJsonExtensionsTests.cs (2)
510var client = app.GetTestClient(); 542var client = app.GetTestClient();
Microsoft.AspNetCore.HttpLogging.Tests (11)
HttpLoggingMiddlewareTests.cs (11)
1730var client = server.CreateClient(); 1745var client = server.CreateClient(); 1760var client = server.CreateClient(); 1775var client = server.CreateClient(); 1801var client = server.CreateClient(); 1820var client = server.CreateClient(); 1835var client = server.CreateClient(); 1850var client = server.CreateClient(); 1865var client = server.CreateClient(); 1891var client = server.CreateClient(); 1937var client = server.CreateClient();
Microsoft.AspNetCore.HttpsPolicy.Tests (18)
HstsMiddlewareTests.cs (8)
63var client = server.CreateClient(); 110var client = server.CreateClient(); 156var client = server.CreateClient(); 201var client = server.CreateClient(); 256var client = server.CreateClient(); 311var client = server.CreateClient(); 358var client = server.CreateClient(); 404var client = server.CreateClient();
HttpsPolicyTests.cs (1)
63var client = server.CreateClient();
HttpsRedirectionMiddlewareTests.cs (9)
49var client = server.CreateClient(); 104var client = server.CreateClient(); 160var client = server.CreateClient(); 222var client = server.CreateClient(); 262var client = server.CreateClient(); 308var client = server.CreateClient(); 350var client = server.CreateClient(); 399var client = server.CreateClient(); 443var client = server.CreateClient();
Microsoft.AspNetCore.Identity.FunctionalTests (162)
AuthorizationTests.cs (4)
43var client = ServerFactory 80var client = ServerFactory 115var client = ServerFactory 143var client = ServerFactory.WithWebHostBuilder(whb => whb.ConfigureServices(TestServicesConfiguration))
Extensions\HttpClientExtensions.cs (3)
12this HttpClient client, 20this HttpClient client, 31this HttpClient client,
Infrastructure\DefaultUIPage.cs (1)
11public DefaultUIPage(HttpClient client, IHtmlDocument document, DefaultUIContext context)
Infrastructure\HtmlPage.cs (2)
11public HtmlPage(HttpClient client, IHtmlDocument document, TApplicationContext context) 18public HttpClient Client { get; }
LoginTests.cs (34)
26var client = ServerFactory.CreateClient(); 27var newClient = ServerFactory.CreateClient(); 49var client = server.CreateClient(); 50var newClient = server.CreateClient(); 66var client = ServerFactory.CreateClient(); 67var newClient = ServerFactory.CreateClient(); 92var client = server.CreateClient(); 93var newClient = server.CreateClient(); 112var client = ServerFactory.CreateClient(); 113var newClient = ServerFactory.CreateClient(); 137var client = server.CreateClient(); 138var newClient = server.CreateClient(); 164var client = server.CreateClient(); 165var newClient = server.CreateClient(); 189var client = server.CreateClient(); 190var newClient = server.CreateClient(); 213var client = server.CreateClient(); 214var newClient = server.CreateClient(); 240var client = server.CreateClient(); 241var newClient = server.CreateClient(); 268var client = server.CreateClient(); 269var newClient = server.CreateClient(); 293var client = server.CreateClient(); 294var newClient = server.CreateClient(); 315var client = server.CreateClient(); 316var newClient = server.CreateClient(); 337var client = server.CreateClient(); 338var resetPasswordClient = server.CreateClient(); 339var newClient = server.CreateClient(); 367var client = server.CreateClient(); 368var resetPasswordClient = server.CreateClient(); 369var newClient = server.CreateClient(); 397var client = server.CreateClient(); 398var newClient = server.CreateClient();
ManagementTests.cs (18)
28var client = ServerFactory 44var client = ServerFactory 66var client = server.CreateClient(); 90var client = server.CreateClient(); 91var newClient = server.CreateClient(); 92var failedClient = server.CreateClient(); 122var client = server.CreateClient(); 123var newClient = server.CreateClient(); 159var client = server.CreateClient(); 160var newClient = server.CreateClient(); 161var loginAfterSetPasswordClient = server.CreateClient(); 199var client = server.CreateClient(); 223var client = server.CreateClient(); 249var client = server.CreateClient(); 250var newClient = server.CreateClient(); 280var client = ServerFactory 337var client = ServerFactory 353var client = ServerFactory
MapIdentityApiTests.cs (40)
44using var client = app.GetTestClient(); 53using var client = app.GetTestClient(); 63using var client = app.GetTestClient(); 74using var client = app.GetTestClient(); 85using var client = app.GetTestClient(); 95using var client = app.GetTestClient(); 107using var client = app.GetTestClient(); 140using var client = app.GetTestClient(); 177using var client = app.GetTestClient(); 208using var client = app.GetTestClient(); 231using var client = app.GetTestClient(); 256using var client = app.GetTestClient(); 276using var client = app.GetTestClient(); 292using var client = app.GetTestClient(); 311using var client = app.GetTestClient(); 337using var client = app.GetTestClient(); 381using var client = app.GetTestClient(); 400using var client = app.GetTestClient(); 433using var client = app.GetTestClient(); 463using var client = app.GetTestClient(); 491using var client = app.GetTestClient(); 516using var client = app.GetTestClient(); 541using var client = app.GetTestClient(); 576using var client = app.GetTestClient(); 605using var client = app.GetTestClient(); 652using var client = app.GetTestClient(); 667using var client = app.GetTestClient(); 725using var client = app.GetTestClient(); 777using var client = app.GetTestClient(); 824using var client = app.GetTestClient(); 893using var client = app.GetTestClient(); 961using var client = app.GetTestClient(); 1032using var client = app.GetTestClient(); 1123using var client = app.GetTestClient(); 1198using var client = app.GetTestClient(); 1227using var client = app.GetTestClient(); 1380private async Task RegisterAsync(HttpClient client, string? groupPrefix = null, string? email = null) 1388private async Task<string> LoginAsync(HttpClient client, string? groupPrefix = null, string? email = null) 1405private async Task<string> LoginWithEmailConfirmationAsync(HttpClient client, TestEmailSender emailSender, string? groupPrefix = null, string? email = null) 1466private static void ApplyCookies(HttpClient client, HttpResponseMessage response)
NoIdentityAddedTests.cs (1)
27var client = ServerFactory
Pages\Account\ConfirmEmail.cs (2)
12HttpClient client, 18public static async Task<ConfirmEmail> Create(IHtmlAnchorElement link, HttpClient client, DefaultUIContext context)
Pages\Account\ExternalLogin.cs (1)
14HttpClient client,
Pages\Account\ForgotPassword.cs (1)
13public ForgotPassword(HttpClient client, IHtmlDocument document, DefaultUIContext context) : base(client, document, context)
Pages\Account\ForgotPasswordConfirmation.cs (1)
11public ForgotPasswordConfirmation(HttpClient client, IHtmlDocument document, DefaultUIContext context) : base(client, document, context)
Pages\Account\Login.cs (1)
19HttpClient client,
Pages\Account\LoginWith2fa.cs (1)
17public LoginWith2fa(HttpClient client, IHtmlDocument loginWithTwoFactor, DefaultUIContext context)
Pages\Account\LoginWithRecoveryCode.cs (1)
13public LoginWithRecoveryCode(HttpClient client, IHtmlDocument loginWithRecoveryCode, DefaultUIContext context)
Pages\Account\Manage\ChangePassword.cs (1)
13public ChangePassword(HttpClient client, IHtmlDocument changePassword, DefaultUIContext context)
Pages\Account\Manage\DeleteUser.cs (1)
13public DeleteUser(HttpClient client, IHtmlDocument deleteUser, DefaultUIContext context)
Pages\Account\Manage\Email.cs (1)
19public Email(HttpClient client, IHtmlDocument manage, DefaultUIContext context)
Pages\Account\Manage\EnableAuthenticator.cs (1)
18HttpClient client,
Pages\Account\Manage\ExternalLogins.cs (1)
11public ExternalLogins(HttpClient client, IHtmlDocument externalLoginDocument, DefaultUIContext context)
Pages\Account\Manage\Index.cs (1)
22public Index(HttpClient client, IHtmlDocument manage, DefaultUIContext context)
Pages\Account\Manage\LinkExternalLogin.cs (1)
14public LinkExternalLogin(HttpClient client, IHtmlDocument externalLoginsDocument, DefaultUIContext context)
Pages\Account\Manage\ManageExternalLogin.cs (1)
13public ManageExternalLogin(HttpClient client, IHtmlDocument externalLoginDocument, DefaultUIContext context)
Pages\Account\Manage\PersonalData.cs (1)
14public PersonalData(HttpClient client, IHtmlDocument personalData, DefaultUIContext context)
Pages\Account\Manage\RemoveExternalLogin.cs (1)
13public RemoveExternalLogin(HttpClient client, IHtmlDocument externalLogin, DefaultUIContext context)
Pages\Account\Manage\ResetAuthenticator.cs (1)
15HttpClient client,
Pages\Account\Manage\SetPassword.cs (1)
13public SetPassword(HttpClient client, IHtmlDocument setPassword, DefaultUIContext context)
Pages\Account\Manage\ShowRecoveryCodes.cs (1)
13public ShowRecoveryCodes(HttpClient client, IHtmlDocument showRecoveryCodes, DefaultUIContext context)
Pages\Account\Manage\TwoFactorAuthentication.cs (1)
14public TwoFactorAuthentication(HttpClient client, IHtmlDocument twoFactor, DefaultUIContext context)
Pages\Account\Register.cs (1)
15public Register(HttpClient client, IHtmlDocument register, DefaultUIContext context)
Pages\Account\ResendEmailConfirmation.cs (1)
13public ResendEmailConfirmation(HttpClient client, IHtmlDocument document, DefaultUIContext context) : base(client, document, context)
Pages\Account\ResetPassword.cs (2)
13public ResetPassword(HttpClient client, IHtmlDocument resetPassword, DefaultUIContext context) : base(client, resetPassword, context) 18internal static async Task<ResetPassword> CreateAsync(IHtmlAnchorElement link, HttpClient client, DefaultUIContext context)
Pages\Account\ResetPasswordConfirmation.cs (1)
11public ResetPasswordConfirmation(HttpClient client, IHtmlDocument resetPasswordConfirmation, DefaultUIContext context)
Pages\Contoso\Login.cs (1)
14public Login(HttpClient client, IHtmlDocument login, DefaultUIContext context)
Pages\Index.cs (2)
18HttpClient client, 34public static async Task<Index> CreateAsync(HttpClient client, DefaultUIContext context = null)
Pages\RegisterConfirmation.cs (1)
16HttpClient client,
RegistrationTests.cs (12)
29var client = ServerFactory 48var client = server.CreateClient(); 49var client2 = server.CreateClient(); 81var client = server.CreateClient(); 82var client2 = server.CreateClient(); 101var client = ServerFactory 120var client = ServerFactory 142var client = ServerFactory 167var client = ServerFactory 188var client = ServerFactory 209var client = ServerFactory 233var client = ServerFactory
UserStories.cs (16)
16internal static async Task<Index> RegisterNewUserAsync(HttpClient client, string userName = null, string password = null) 27internal static async Task<RegisterConfirmation> RegisterNewUserAsyncWithConfirmation(HttpClient client, string userName = null, string password = null, bool hasRealEmailSender = false) 38internal static async Task<Index> LoginExistingUserAsync(HttpClient client, string userName, string password) 47internal static async Task LoginFailsWithWrongPasswordAsync(HttpClient client, string userName, string password) 56internal static async Task<DefaultUIPage> LockoutExistingUserAsync(HttpClient client, string userName, string password) 66internal static async Task<Index> RegisterNewUserWithSocialLoginAsync(HttpClient client, string userName, string email) 79internal static async Task<RegisterConfirmation> RegisterNewUserWithSocialLoginWithConfirmationAsync(HttpClient client, string userName, string email, bool hasRealEmailSender = false) 92internal static async Task<Index> RegisterNewUserWithSocialLoginAsyncViaRegisterPage(HttpClient client, string userName, string email) 119internal static async Task<Index> LoginWithSocialLoginAsync(HttpClient client, string userName) 134internal static async Task<Index> LoginExistingUser2FaAsync(HttpClient client, string userName, string password, string twoFactorKey) 166HttpClient client, 182internal static async Task<ConfirmEmail> ConfirmEmailAsync(IdentityEmail email, HttpClient client) 193internal static async Task ResendConfirmEmailAsync(HttpClient client, string email) 203internal static async Task<ForgotPasswordConfirmation> ForgotPasswordAsync(HttpClient client, string userName) 214internal static async Task<ResetPasswordConfirmation> ResetPasswordAsync(HttpClient client, IdentityEmail resetPasswordEmail, string email, string newPassword) 274internal static async Task AcceptCookiePolicy(HttpClient client)
Microsoft.AspNetCore.Identity.Test (1)
IdentityUIScriptsTest.cs (1)
18private readonly HttpClient _httpClient;
Microsoft.AspNetCore.Localization.FunctionalTests (2)
LocalizationSampleTest.cs (1)
31var client = testHost.CreateClient();
LocalizationTest.cs (1)
110var client = testHost.CreateClient();
Microsoft.AspNetCore.Localization.Routing.Tests (3)
RouteDataRequestCultureProviderTest.cs (3)
83var client = server.CreateClient(); 129var client = server.CreateClient(); 205var client = server.CreateClient();
Microsoft.AspNetCore.Localization.Tests (19)
AcceptLanguageHeaderRequestCultureProviderTest.cs (4)
48var client = server.CreateClient(); 89var client = server.CreateClient(); 129var client = server.CreateClient(); 175var client = server.CreateClient();
CookieRequestCultureProviderTest.cs (5)
62var client = server.CreateClient(); 114var client = server.CreateClient(); 163var client = server.CreateClient(); 212var client = server.CreateClient(); 272var client = server.CreateClient();
CustomRequestCultureProviderTest.cs (1)
59var client = server.CreateClient();
QueryStringRequestCultureProviderTest.cs (8)
52var client = server.CreateClient(); 86var client = server.CreateClient(); 127var client = server.CreateClient(); 168var client = server.CreateClient(); 210var client = server.CreateClient(); 252var client = server.CreateClient(); 299var client = server.CreateClient(); 347var client = server.CreateClient();
RequestLocalizationMiddlewareTest.cs (1)
65var client = server.CreateClient();
Microsoft.AspNetCore.Mvc.FunctionalTests (143)
AntiforgeryAuthTests.cs (1)
29public HttpClient Client { get; private set; }
AntiforgeryMiddlewareTest.cs (5)
35var client = app.GetTestClient(); 81var client = app.GetTestClient(); 119var client = app.GetTestClient(); 151var client = app.GetTestClient(); 183var client = app.GetTestClient();
AntiforgeryTests.cs (1)
28public HttpClient Client { get; private set; }
ApiBehaviorTest.cs (2)
40public HttpClient Client { get; private set; } 430var customInvalidModelStateClient = factory.CreateDefaultClient();
ApiExplorerTest.cs (1)
33public HttpClient Client { get; private set; }
ApplicationModelTest.cs (1)
28public HttpClient Client { get; private set; }
AsyncActionsTests.cs (1)
28public HttpClient Client { get; private set; }
AsyncDisposalTest.cs (1)
38public HttpClient Client { get; private set; }
AsyncEnumerableTestBase.cs (1)
31public HttpClient Client { get; private set; }
AuthMiddlewareAndFilterTestBase.cs (1)
33public HttpClient Client { get; private set; }
AuthMiddlewareUsingRequireAuthTest.cs (1)
33public HttpClient Client { get; private set; }
BasicTests.cs (1)
39public HttpClient Client { get; private set; }
ClientValidationOptionsTests.cs (1)
31var client = Factory
CompilationOptionsTests.cs (1)
29public HttpClient Client { get; private set; }
ComponentRenderingFunctionalTests.cs (8)
37var client = CreateClient(Factory); 52var client = CreateClient(Factory.WithWebHostBuilder(builder => 70var client = CreateClient(fixture); 83var client = CreateClient(Factory.WithWebHostBuilder(builder => 99var client = CreateClient(Factory.WithWebHostBuilder(builder => 163var client = CreateClient(Factory); 190private HttpClient CreateClient( 195var client = fixture
ConsumesAttributeTestsBase.cs (1)
38public HttpClient Client { get; private set; }
ContentNegotiationTest.cs (1)
35public HttpClient Client { get; private set; }
ControllerEndpointFiltersTest.cs (4)
39using var client = Factory.CreateClient(); 52using var client = Factory.CreateClient(); 65using var client = Factory.CreateClient(); 77using var client = Factory.CreateClient();
ControllerFromServicesTests.cs (1)
28public HttpClient Client { get; private set; }
CorsTestsBase.cs (1)
34public HttpClient Client { get; private set; }
CustomValueProviderTest.cs (1)
36public HttpClient Client { get; private set; }
DataAnnotationTests.cs (1)
35public HttpClient Client { get; private set; }
DefaultValuesTest.cs (1)
27public HttpClient Client { get; private set; }
DirectivesTest.cs (1)
27public HttpClient Client { get; private set; }
DoNotRespectBrowserAcceptHeaderTests.cs (1)
36public HttpClient Client { get; private set; }
ErrorPageTests.cs (2)
46public HttpClient Client { get; private set; } 55var client = factory.CreateDefaultClient();
FileResultTests.cs (1)
31public HttpClient Client { get; private set; }
FiltersTest.cs (1)
30public HttpClient Client { get; private set; }
FlushPointTest.cs (1)
27public HttpClient Client { get; private set; }
FormFileUploadTest.cs (1)
28public HttpClient Client { get; private set; }
GlobalAuthorizationFilterTestBase.cs (1)
30public HttpClient Client { get; private set; }
HtmlGenerationTest.cs (3)
40public HttpClient Client { get; private set; } 41public HttpClient EncodedClient { get; private set; } 216var client = Factory
HtmlGenerationWithCultureTest.cs (2)
39public HttpClient Client { get; private set; } 139var client = Factory
HtmlHelperOptionsTest.cs (1)
30public HttpClient Client { get; private set; }
HttpActionResultTests.cs (1)
30public HttpClient Client { get; private set; }
Infrastructure\HttpClientExtensions.cs (1)
14public static async Task<IHtmlDocument> GetHtmlDocumentAsync(this HttpClient client, string requestUri)
InputFormatterTests.cs (1)
35public HttpClient Client { get; private set; }
InputObjectValidationTests.cs (1)
35public HttpClient Client { get; private set; }
InputParentValidationTests.cs (1)
39public HttpClient Client { get; private set; }
InputValidationTests.cs (1)
30public HttpClient Client { get; private set; }
JsonInputFormatterTestBase.cs (1)
37public HttpClient Client { get; private set; }
JsonOutputFormatterTestBase.cs (1)
38public HttpClient Client { get; private set; }
JsonPatchInputFormatterTest.cs (1)
31public HttpClient Client { get; private set; }
JsonResultWithNewtonsoftJsonTest.cs (1)
36public HttpClient Client { get; private set; }
JsonResultWithSystemTextJsonTest.cs (1)
36public HttpClient Client { get; private set; }
KeyedServicesTests.cs (1)
27public HttpClient Client { get; private set; }
LinkGenerationTests.cs (1)
38public HttpClient Client { get; private set; }
LinkGeneratorTest.cs (1)
35public HttpClient Client { get; private set; }
LinkParserTest.cs (1)
35public HttpClient Client { get; private set; }
MvcSandboxTest.cs (1)
28public HttpClient Client { get; private set; }
NonNullableReferenceTypesTest.cs (1)
29public HttpClient Client { get; private set; }
OutputFormatterTest.cs (1)
29public HttpClient Client { get; private set; }
PageAsyncDisposalTest.cs (1)
36public HttpClient Client { get; private set; }
RazorBuildTest.cs (1)
50public HttpClient Client { get; private set; }
RazorPageModelTest.cs (1)
33public HttpClient Client { get; private set; }
RazorPagesNamespaceTest.cs (1)
32public HttpClient Client { get; private set; }
RazorPagesTest.cs (1)
40public HttpClient Client { get; private set; }
RazorPagesViewSearchTest.cs (1)
32public HttpClient Client { get; private set; }
RazorPagesWithBasePathTest.cs (1)
29public HttpClient Client { get; private set; }
RazorPagesWithEndpointRoutingTest.cs (1)
28public HttpClient Client { get; private set; }
RazorRuntimeCompilationHostingStartupTest.cs (1)
47public HttpClient Client { get; private set; }
RazorViewLocationSpecificationTest.cs (1)
30public HttpClient Client { get; private set; }
ReadFromDisconnectedClientTest.cs (1)
36public HttpClient Client { get; private set; }
RemoteAttributeValidationTest.cs (1)
31public HttpClient Client { get; private set; }
RequestFormLimitsTest.cs (1)
33public HttpClient Client { get; private set; }
RequestServicesTestBase.cs (1)
36public HttpClient Client { get; private set; }
RequestSizeLimitTest.cs (1)
34public HttpClient Client { get; private set; }
RespectBrowserAcceptHeaderTests.cs (1)
37public HttpClient Client { get; private set; }
RoutingAcrossPipelineBranchesTest.cs (6)
34public HttpClient Client { get; private set; } 39var client = Factory.CreateClient(); 73var client = Factory.CreateClient(); 107var client = Factory.CreateClient(); 137var client = Factory.CreateClient(); 160var client = Factory.CreateClient();
RoutingDynamicOrderTest.cs (6)
40var client = factory.CreateClient(); 62var client = factory.CreateClient(); 85var client = factory.CreateClient(); 107var client = factory.CreateClient(); 130var client = factory.CreateClient(); 151var client = factory.CreateClient();
RoutingDynamicTest.cs (3)
33public HttpClient Client { get; private set; } 147var client = Factory.WithWebHostBuilder(b => b.UseStartup<StartupForDynamicAndRazorPages>()).CreateDefaultClient(); 164var client = Factory.WithWebHostBuilder(b => b.UseStartup<StartupForDynamicAndRazorPages>()).CreateDefaultClient();
RoutingFallbackTest.cs (1)
34public HttpClient Client { get; private set; }
RoutingGroupsTest.cs (3)
35public HttpClient Client { get; private set; } 40using var client = Factory.CreateClient(); 53using var client = Factory.CreateClient();
RoutingGroupsWithMetadataTest.cs (1)
38using var client = Factory.CreateClient();
RoutingTestsBase.cs (1)
34public HttpClient Client { get; private set; }
RoutingWithoutRazorPagesTestsBase.cs (1)
34public HttpClient Client { get; private set; }
SerializableErrorTests.cs (1)
31public HttpClient Client { get; private set; }
SimpleTests.cs (1)
27public HttpClient Client { get; private set; }
SimpleWithWebApplicationBuilderTests.cs (5)
37public HttpClient Client { get; private set; } 142using var client = new WebApplicationFactory<SimpleWebSiteWithWebApplicationBuilder.Program>().CreateClient(); 169using var client = fixture.CreateDefaultClient(); 188using var client = fixture.CreateDefaultClient(); 209using var client = fixture.CreateDefaultClient();
StreamOutputFormatterTest.cs (1)
27public HttpClient Client { get; private set; }
SystemTextJsonOutputFormatterTest.cs (1)
36var client = Factory.WithWebHostBuilder(c => c.ConfigureServices(ConfigureServices)).CreateClient();
TagHelperComponentTagHelperTest.cs (1)
30public HttpClient Client { get; private set; }
TagHelpersFromServicesTest.cs (1)
27public HttpClient Client { get; private set; }
TagHelpersTest.cs (2)
39public HttpClient Client { get; private set; } 41public HttpClient EncodedClient { get; private set; }
TempDataInCookiesUsingCookieConsentTest.cs (1)
31public HttpClient Client { get; private set; }
TempDataPropertyTest.cs (1)
29public HttpClient Client { get; private set; }
TempDataTestBase.cs (1)
31public HttpClient Client { get; private set; }
TestingInfrastructureInheritanceTests.cs (2)
24var client = customized.CreateClient(); 44var client = customized.CreateClient();
TestingInfrastructureTests.cs (6)
31public HttpClient Client { get; } 101var client = Factory.CreateDefaultClient( 117var client = Factory.CreateDefaultClient( 131var client = Factory.CreateDefaultClient( 144var client = Factory.CreateDefaultClient( 235var client = Factory.CreateDefaultClient(
UrlResolutionTest.cs (2)
34public HttpClient Client { get; private set; } 36public HttpClient EncodedClient { get; private set; }
VersioningTestsBase.cs (1)
34public HttpClient Client { get; private set; }
ViewComponentFromServicesTests.cs (1)
28public HttpClient Client { get; private set; }
ViewEngineTests.cs (1)
33public HttpClient Client { get; private set; }
XmlDataContractSerializerFormattersWrappingTest.cs (1)
33public HttpClient Client { get; private set; }
XmlDataContractSerializerInputFormatterTest.cs (1)
31public HttpClient Client { get; private set; }
XmlOutputFormatterTests.cs (1)
30public HttpClient Client { get; private set; }
XmlSerializerFormattersWrappingTest.cs (1)
35public HttpClient Client { get; private set; }
XmlSerializerInputFormatterTests.cs (1)
31public HttpClient Client { get; private set; }
Microsoft.AspNetCore.Mvc.Testing (32)
WebApplicationFactory.cs (27)
32private readonly List<HttpClient> _clients = new(); 39/// and one or more <see cref="HttpClient"/> instances used to send <see cref="HttpRequestMessage"/> to the <see cref="TestServer"/>. 454/// Creates an instance of <see cref="HttpClient"/> that automatically follows 457/// <returns>The <see cref="HttpClient"/>.</returns> 458public HttpClient CreateClient() => 462/// Creates an instance of <see cref="HttpClient"/> that automatically follows 465/// <returns>The <see cref="HttpClient"/>.</returns> 466public HttpClient CreateClient(WebApplicationFactoryClientOptions options) => 470/// Creates a new instance of an <see cref="HttpClient"/> that can be used to 471/// send <see cref="HttpRequestMessage"/> to the server. The base address of the <see cref="HttpClient"/> 475/// <see cref="HttpClient"/>.</param> 476/// <returns>The <see cref="HttpClient"/>.</returns> 477public HttpClient CreateDefaultClient(params DelegatingHandler[] handlers) 481HttpClient client; 507/// Configures <see cref="HttpClient"/> instances created by this <see cref="WebApplicationFactory{TEntryPoint}"/>. 509/// <param name="client">The <see cref="HttpClient"/> instance getting configured.</param> 510protected virtual void ConfigureClient(HttpClient client) 518/// Creates a new instance of an <see cref="HttpClient"/> that can be used to 521/// <param name="baseAddress">The base address of the <see cref="HttpClient"/> instance.</param> 523/// <see cref="HttpClient"/>.</param> 524/// <returns>The <see cref="HttpClient"/>.</returns> 525public HttpClient CreateDefaultClient(Uri baseAddress, params DelegatingHandler[] handlers) 527var client = CreateDefaultClient(handlers); 582foreach (var client in _clients) 614private readonly Action<HttpClient> _configureClient; 623Action<HttpClient> configureClient, 648protected override void ConfigureClient(HttpClient client) => _configureClient(client);
WebApplicationFactoryClientOptions.cs (5)
12/// <see cref="HttpClient"/> instances by calling 34/// Gets or sets the base address of <see cref="HttpClient"/> instances created by calling 41/// Gets or sets whether or not <see cref="HttpClient"/> instances created by calling 49/// Gets or sets the maximum number of redirect responses that <see cref="HttpClient"/> instances 57/// Gets or sets whether <see cref="HttpClient"/> instances created by calling
Microsoft.AspNetCore.OutputCaching.Tests (41)
OutputCacheTests.cs (41)
28var client = server.CreateClient(); 50var client = server.CreateClient(); 70var client = server.CreateClient(); 90var client = server.CreateClient(); 110var client = server.CreateClient(); 132var client = server.CreateClient(); 163var client = server.CreateClient(); 194var client = server.CreateClient(); 217var client = server.CreateClient(); 244var client = server.CreateClient(); 267var client = server.CreateClient(); 295var client = server.CreateClient(); 316var client = server.CreateClient(); 340var client = server.CreateClient(); 365var client = server.CreateClient(); 388var client = server.CreateClient(); 411var client = server.CreateClient(); 434var client = server.CreateClient(); 457var client = server.CreateClient(); 479var client = server.CreateClient(); 502var client = server.CreateClient(); 524var client = server.CreateClient(); 546var client = server.CreateClient(); 566var client = server.CreateClient(); 590var client = server.CreateClient(); 615var client = server.CreateClient(); 635var client = server.CreateClient(); 659var client = server.CreateClient(); 683var client = server.CreateClient(); 709var client = server.CreateClient(); 732var client = server.CreateClient(); 758var client = server.CreateClient(); 781var client = server.CreateClient(); 808var client = server.CreateClient(); 831var client = server.CreateClient(); 854var client = server.CreateClient(); 874var client = server.CreateClient(); 898var client = server.CreateClient(); 931var client = server.CreateClient(); 960var client = server.CreateClient(); 1002var client = server.CreateClient();
Microsoft.AspNetCore.RequestDecompression.Tests (6)
RequestDecompressionMiddlewareTests.cs (6)
237var client = server.CreateClient(); 308var client = server.CreateClient(); 384var client = server.CreateClient(); 486var client = server.CreateClient(); 570var client = server.CreateClient(); 721var client = server.CreateClient();
Microsoft.AspNetCore.ResponseCaching.Tests (37)
ResponseCachingTests.cs (37)
28var client = server.CreateClient(); 52var client = server.CreateClient(); 74var client = server.CreateClient(); 96var client = server.CreateClient(); 118var client = server.CreateClient(); 142var client = server.CreateClient(); 175var client = server.CreateClient(); 208var client = server.CreateClient(); 232var client = server.CreateClient(); 256var client = server.CreateClient(); 279var client = server.CreateClient(); 302var client = server.CreateClient(); 326var client = server.CreateClient(); 348var client = server.CreateClient(); 370var client = server.CreateClient(); 392var client = server.CreateClient(); 414var client = server.CreateClient(); 436var client = server.CreateClient(); 458var client = server.CreateClient(); 480var client = server.CreateClient(); 502var client = server.CreateClient(); 528var client = server.CreateClient(); 555var client = server.CreateClient(); 577var client = server.CreateClient(); 603var client = server.CreateClient(); 629var client = server.CreateClient(); 656var client = server.CreateClient(); 681var client = server.CreateClient(); 709var client = server.CreateClient(); 734var client = server.CreateClient(); 760var client = server.CreateClient(); 785var client = server.CreateClient(); 810var client = server.CreateClient(); 832var client = server.CreateClient(); 858var client = server.CreateClient(); 893var client = server.CreateClient(); 928var client = server.CreateClient();
Microsoft.AspNetCore.ResponseCompression.Tests (17)
ResponseCompressionMiddlewareTest.cs (17)
175var client = server.CreateClient(); 333var client = server.CreateClient(); 472var client = server.CreateClient(); 535var client = server.CreateClient(); 598var client = server.CreateClient(); 651var client = server.CreateClient(); 696var client = server.CreateClient(); 748var client = server.CreateClient(); 801var client = server.CreateClient(); 871var client = server.CreateClient(); 935var client = server.CreateClient(); 999var client = server.CreateClient(); 1060var client = server.CreateClient(); 1110var client = server.CreateClient(); 1160var client = server.CreateClient(); 1210var client = server.CreateClient(); 1276var client = server.CreateClient();
Microsoft.AspNetCore.Routing.FunctionalTests (32)
Benchmarks\EndpointRoutingBenchmarkTest.cs (1)
15private readonly HttpClient _client;
Benchmarks\RouterBenchmarkTest.cs (1)
16private readonly HttpClient _client;
EndpointRoutingSampleTest.cs (1)
14private readonly HttpClient _client;
HostMatchingTests.cs (7)
19private HttpClient CreateClient(string baseAddress) 21var client = _fixture.CreateClient(baseAddress); 35var client = CreateClient(baseAddress); 53var client = CreateClient(baseAddress); 71var client = CreateClient(baseAddress); 89var client = CreateClient(baseAddress); 107var client = CreateClient(baseAddress);
MapFallbackTest.cs (1)
13private readonly HttpClient _client;
MinimalFormTests.cs (14)
48var client = server.CreateClient(); 108var client = server.CreateClient(); 158var client = server.CreateClient(); 197var client = server.CreateClient(); 274var client = server.CreateClient(); 321var client = server.CreateClient(); 417var client = server.CreateClient(); 469var client = server.CreateClient(); 528var client = server.CreateClient(); 580var client = server.CreateClient(); 632var client = server.CreateClient(); 681var client = server.CreateClient(); 721var client = server.CreateClient(); 748var client = server.CreateClient();
RouteHandlerTest.cs (2)
45var client = server.CreateClient(); 95var client = server.CreateClient();
RouterSampleTest.cs (1)
14private readonly HttpClient _client;
RoutingTestFixture.cs (3)
34public HttpClient Client { get; } 36public HttpClient CreateClient(string baseAddress) 38var client = _server.CreateClient();
WebHostBuilderExtensionsTest.cs (1)
94var client = testServer.CreateClient();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (53)
AuthenticationTests.cs (1)
461using (HttpClient client = new HttpClient(handler))
DelegateTests.cs (2)
270using var client = new HttpClient(); 276using var client = new HttpClient();
Http2Tests.cs (2)
624using HttpClient client = new HttpClient(handler); 646using HttpClient client = new HttpClient(handler);
Http3Tests.cs (8)
41using var client = new HttpClient(handler); 71using var client = new HttpClient(handler); 111using var client = new HttpClient(handler); 145using var client = new HttpClient(handler); 173using var client = new HttpClient(handler); 203using var client = new HttpClient(handler); 228using var client = new HttpClient(handler); 252using var client = new HttpClient(handler);
HttpsTests.cs (2)
273using HttpClient client = new HttpClient(handler); 281using (HttpClient client = new HttpClient(handler))
Listener\AuthenticationOnExistingQueueTests.cs (1)
223using HttpClient client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(5) };
Listener\RequestBodyTests.cs (2)
177var client = new HttpClient(); 202using (HttpClient client = new HttpClient())
Listener\ResponseBodyTests.cs (5)
366using (var client = new HttpClient()) 406using (var client = new HttpClient()) 445using (var client = new HttpClient()) 479using (var client = new HttpClient()) 508using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout })
Listener\ResponseHeaderTests.cs (3)
20private HttpClient _client = new HttpClient(); 225using (var client = new HttpClient(handler)) 339private async Task<HttpResponseMessage> SendRequestAsync(string uri, bool usehttp11 = true, bool sendKeepAlive = false, HttpClient httpClient = null)
Listener\ServerOnExistingQueueTests.cs (2)
320using HttpClient client = new HttpClient(); 326using HttpClient client = new HttpClient();
Listener\ServerTests.cs (3)
30using (var client = new HttpClient()) 59using (var client = new HttpClient()) 208using (HttpClient client = new HttpClient())
OpaqueUpgradeTests.cs (2)
295using var client = new HttpClient(); 371using (HttpClient client = new HttpClient())
RequestBodyLimitTests.cs (1)
412using (HttpClient client = new HttpClient())
RequestBodyTests.cs (1)
301using (HttpClient client = new HttpClient())
RequestHeaderTests.cs (2)
235HttpClient client = new HttpClient(); 246using (HttpClient client = new HttpClient())
RequestTests.cs (1)
619using (HttpClient client = new HttpClient())
ResponseBodyTests.cs (1)
439using (HttpClient client = new HttpClient())
ResponseCachingTests.cs (2)
471using (var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) }) 486using (var client = new HttpClient() { Timeout = TimeSpan.FromSeconds(10) })
ResponseHeaderTests.cs (4)
129var httpClient = new HttpClient(socketsHttpHandler); 170using (HttpClient client = new HttpClient()) 197using (HttpClient client = new HttpClient()) 329using (HttpClient client = new HttpClient())
ResponseSendFileTests.cs (3)
612using (var client = new HttpClient()) 661using (var client = new HttpClient()) 681using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout })
ResponseTests.cs (1)
281using (var client = new HttpClient())
ResponseTrailersTests.cs (1)
363using HttpClient client = new HttpClient(handler);
ServerTests.cs (3)
369using (HttpClient client4 = new HttpClient()) 639using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout }) 647using (HttpClient client = new HttpClient() { Timeout = Utilities.DefaultTimeout })
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
DelegateOutOfProcTests.cs (1)
64using var client = new HttpClient();
Microsoft.AspNetCore.Server.IntegrationTesting (6)
Common\DeploymentResult.cs (4)
38/// An <see cref="HttpClient"/> with <see cref="LoggingHandler"/> configured and the <see cref="HttpClient.BaseAddress"/> set to the <see cref="ApplicationBaseUri"/> 40public HttpClient HttpClient { get; } 59/// Create an <see cref="HttpClient"/> with <see cref="LoggingHandler"/> configured and the <see cref="HttpClient.BaseAddress"/> set to the <see cref="ApplicationBaseUri"/>, 64public HttpClient CreateHttpClient(HttpMessageHandler baseHandler) =>
Common\LoggingHandler.cs (1)
15_logger = loggerFactory.CreateLogger<HttpClient>();
Deployers\NginxDeployer.cs (1)
78using (var httpClient = new HttpClient())
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (2)
IISDeploymentResult.cs (2)
37public HttpClient CreateClient(HttpMessageHandler messageHandler) 51public new HttpClient HttpClient { get; set; }
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (5)
WebHostTests.cs (5)
75using (var client = CreateClient()) 243using (var client = CreateClient()) 314using (var client = CreateClient()) 349using (var client = CreateClient()) 415private static HttpClient CreateClient()
Microsoft.AspNetCore.Session.Tests (21)
SessionTests.cs (21)
54var client = server.CreateClient(); 91var client = server.CreateClient(); 146var client = server.CreateClient(); 197var client = server.CreateClient(); 257var client = server.CreateClient(); 315var client = server.CreateClient(); 361var client = server.CreateClient(); 420var client = server.CreateClient(); 489var client = server.CreateClient(); 545var client = server.CreateClient(); 595var client = server.CreateClient(); 631var client = server.CreateClient(); 676var client = server.CreateClient(); 725var client = server.CreateClient(); 774var client = server.CreateClient(); 822var client = server.CreateClient(); 874var client = server.CreateClient(); 937var client = server.CreateClient(); 1003var client = server.CreateClient(); 1068var client = server.CreateClient(); 1120var client = server.CreateClient();
Microsoft.AspNetCore.SignalR.Client.Tests (30)
HttpConnectionTests.ConnectionLifecycle.cs (1)
261using (var httpClient = new HttpClient(testHttpHandler))
LongPollingTransportTests.cs (17)
44using (var httpClient = new HttpClient(mockHttpHandler.Object)) 77using (var httpClient = new HttpClient(mockHttpHandler.Object)) 135using (var httpClient = new HttpClient(mockHttpHandler.Object)) 166using (var httpClient = new HttpClient(mockHttpHandler.Object)) 199using (var httpClient = new HttpClient(mockHttpHandler.Object)) 257using (var httpClient = new HttpClient(mockHttpHandler.Object)) 298using (var httpClient = new HttpClient(mockHttpHandler.Object)) 344using (var httpClient = new HttpClient(mockHttpHandler.Object)) 376using (var httpClient = new HttpClient(mockHttpHandler.Object)) 427using (var httpClient = new HttpClient(mockHttpHandler.Object)) 492using (var httpClient = new HttpClient(mockHttpHandler.Object)) 565using (var httpClient = new HttpClient(mockHttpHandler.Object)) 594using (var httpClient = new HttpClient(mockHttpHandler.Object)) 623using (var httpClient = new HttpClient(mockHttpHandler.Object)) 662using (var httpClient = new HttpClient(mockHttpHandler.Object)) 685using (var httpClient = new HttpClient(handler)) 736using (var httpClient = new HttpClient(testHttpHandler))
SendUtilsTests.cs (1)
35using (var httpClient = new HttpClient(testHttpHandler))
ServerSentEventsTransportTests.cs (11)
49using (var httpClient = new HttpClient(mockHttpHandler.Object)) 94using (var httpClient = new HttpClient(mockHttpHandler.Object)) 147using (var httpClient = new HttpClient(mockHttpHandler.Object)) 203using (var httpClient = new HttpClient(mockHttpHandler.Object)) 253using (var httpClient = new HttpClient(mockHttpHandler.Object)) 280using (var httpClient = new HttpClient(mockHttpHandler.Object)) 334using (var httpClient = new HttpClient(mockHttpHandler.Object)) 369using (var httpClient = new HttpClient(mockHttpHandler.Object)) 396using (var httpClient = new HttpClient(mockHttpHandler.Object)) 428using (var httpClient = new HttpClient(testHttpHandler)) 481using (var httpClient = new HttpClient(mockHttpHandler.Object))
Microsoft.AspNetCore.SignalR.Tests (2)
EndToEndTests.cs (2)
477using (var client = new HttpClient()) 651using (var client = new HttpClient())
Microsoft.AspNetCore.SpaProxy (5)
SpaProxyLaunchManager.cs (5)
75var httpClient = CreateHttpClient(); 94private static HttpClient CreateHttpClient() 96var httpClient = new HttpClient(new HttpClientHandler() 106private async Task<bool> ProbeSpaDevelopmentServerUrl(HttpClient httpClient, CancellationToken cancellationToken) 131var httpClient = CreateHttpClient();
Microsoft.AspNetCore.SpaServices.Extensions (5)
AngularCli\AngularCliMiddleware.cs (1)
105using (var client = new HttpClient())
Proxying\ConditionalProxyMiddleware.cs (1)
20private readonly HttpClient _httpClient;
Proxying\SpaProxy.cs (2)
40public static HttpClient CreateHttpClientForProxy(TimeSpan requestTimeout) 56HttpClient httpClient,
Proxying\SpaProxyingExtensions.cs (1)
70var neverTimeOutHttpClient =
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaProxyTests.cs (1)
19private static (HttpContext, HttpClient) GetHttpContextAndClient(string path, string queryString, Action<HttpRequestMessage> callback)
Microsoft.AspNetCore.StaticAssets.Tests (30)
StaticAssetsIntegrationTests.cs (30)
58var client = app.GetTestClient(); 108var client = app.GetTestClient(); 160var client = app.GetTestClient(); 223var client = app.GetTestClient(); 280var client = app.GetTestClient(); 329var client = app.GetTestClient(); 380var client = app.GetTestClient(); 433var client = app.GetTestClient(); 565private static async Task<HttpClient> CreateClient() 622var client = await CreateClient(); 632var client = await CreateClient(); 650var client = await CreateClient(); 661var client = await CreateClient(); 674var client = await CreateClient(); 685var client = await CreateClient(); 710var client = await CreateClient(); 723var client = await CreateClient(); 736var client = await CreateClient(); 759var client = await CreateClient(); 782var client = await CreateClient(); 798var client = await CreateClient(); 821var client = await CreateClient(); 865var client = await CreateClient(); 878var client = await CreateClient(); 898var client = await CreateClient(); 914var client = await CreateClient(); 939var client = await CreateClient(); 955var client = await CreateClient(); 968var client = await CreateClient(); 980var client = await CreateClient();
Microsoft.AspNetCore.StaticFiles.FunctionalTests (7)
FallbackStaticFileTest.cs (2)
57using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 106using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) })
StaticFileMiddlewareTests.cs (5)
36using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 81using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 106using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 156using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) }) 198using (var client = new HttpClient { BaseAddress = new Uri(Helpers.GetAddress(host)) })
Microsoft.AspNetCore.TestHost (4)
HostBuilderTestServerExtensions.cs (1)
31public static HttpClient GetTestClient(this IHost host)
TestServer.cs (2)
173/// Creates a <see cref="HttpClient" /> for processing HTTP requests/responses with the test server. 175public HttpClient CreateClient()
WebHostBuilderExtensions.cs (1)
64public static HttpClient GetTestClient(this IWebHost host)
Microsoft.AspNetCore.TestHost.Tests (60)
ClientHandlerTests.cs (22)
40var httpClient = new HttpClient(handler); 66var httpClient = new HttpClient(handler); 91var httpClient = new HttpClient(handler); 105var httpClient = new HttpClient(handler); 120var httpClient = new HttpClient(handler); 138var httpClient = new HttpClient(handler); 155var httpClient = new HttpClient(handler); 172var httpClient = new HttpClient(handler); 189var httpClient = new HttpClient(handler); 273var httpClient = new HttpClient(handler); 288var httpClient = new HttpClient(handler); 378var httpClient = new HttpClient(handler); 392var httpClient = new HttpClient(handler); 413var httpClient = new HttpClient(handler); 432var httpClient = new HttpClient(handler); 450var httpClient = new HttpClient(handler); 472var httpClient = new HttpClient(handler); 515var httpClient = new HttpClient(handler); 531var httpClient = new HttpClient(handler); 551var httpClient = new HttpClient(handler); 567var httpClient = new HttpClient(handler); 592var httpClient = new HttpClient(handler);
RequestLifetimeTests.cs (4)
27var client = host.GetTestServer().CreateClient(); 43var client = host.GetTestServer().CreateClient(); 62var client = host.GetTestServer().CreateClient(); 85var client = host.GetTestServer().CreateClient();
ResponseBodyTests.cs (5)
60var client = host.GetTestServer().CreateClient(); 78var client = host.GetTestServer().CreateClient(); 96var client = host.GetTestServer().CreateClient(); 117var client = host.GetTestServer().CreateClient(); 136var client = host.GetTestServer().CreateClient();
ResponseResetTests.cs (7)
28var client = host.GetTestServer().CreateClient(); 44var client = host.GetTestServer().CreateClient(); 60var client = host.GetTestServer().CreateClient(); 79var client = host.GetTestServer().CreateClient(); 98var client = host.GetTestServer().CreateClient(); 120var client = host.GetTestServer().CreateClient(); 146var client = host.GetTestServer().CreateClient();
TestClientTests.cs (21)
31var client = server.CreateClient(); 53var client = server.CreateClient(); 75var client = server.CreateClient(); 95var client = server.CreateClient(); 113var client = server.CreateClient(); 149var client = server.CreateClient(); 194var client = server.CreateClient(); 251var client = server.CreateClient(); 302var client = server.CreateClient(); 359var client = server.CreateClient(); 421var client = server.CreateClient(); 468var client = server.CreateClient(); 519var client = server.CreateClient(); 849var client = server.CreateClient(); 878using var client = server.CreateClient(); 903var client = server.CreateClient(); 931var client = server.CreateClient(); 951var client = server.CreateClient(); 977var client = server.CreateClient(); 1004var client = server.CreateClient(); 1041var client = testServer.CreateClient();
TestServerTests.cs (1)
788var client = server.CreateClient();
Microsoft.AspNetCore.Testing (3)
ServiceFakesHostExtensions.cs (3)
27/// Creates an <see cref="HttpClient"/> to call the hosted application. 32/// <returns>An <see cref="HttpClient"/> configured to call the hosted application.</returns> 35public static HttpClient CreateClient(this IHost host, HttpMessageHandler? handler = null, Func<Uri, bool>? addressFilter = null)
Microsoft.AspNetCore.Testing.Tests (7)
FakesExtensionsTests.cs (7)
60var client = new HttpClient(new FakeCertificateHttpClientHandler(certificate)) 77var client = host.CreateClient(new FakeCertificateHttpClientHandler(certificate)); 88using var client = hostMock.Object.CreateClient(handler); 99using var client = hostMock.Object.CreateClient(); 150using var client = hostMock.Object.CreateClient(null, x => x.AbsoluteUri == _urlAddresses[1]); 162using var client = host.CreateClient(); 174using var client = host.CreateClient();
Microsoft.AspNetCore.Tests (21)
WebApplicationTests.cs (20)
1453var client = app.GetTestClient(); 1602var client = app.GetTestClient(); 1673var client = app.GetTestClient(); 1700var client = app.GetTestClient(); 1738var client = app.GetTestClient(); 1911var client = app.GetTestClient(); 1938var client = app.GetTestClient(); 1998var client = app.GetTestClient(); 2035var client = app.GetTestClient(); 2056var client = app.GetTestClient(); 2087var client = app.GetTestClient(); 2141var client = app.GetTestClient(); 2166var client = app.GetTestClient(); 2409var client = app.GetTestClient(); 2467var client = app.GetTestClient(); 2555var client = app.GetTestClient(); 2581var client = app.GetTestClient(); 2599var client = app.GetTestClient(); 2634var client = app.GetTestClient(); 2664var client = app.GetTestClient();
WebHostTests.cs (1)
80var client = host.GetTestClient();
Microsoft.AspNetCore.WebSockets.ConformanceTests (1)
Autobahn\AutobahnTester.cs (1)
158var client = result.CreateHttpClient(handler);
Microsoft.AspNetCore.WebSockets.Tests (7)
WebSocketCompressionMiddlewareTests.cs (3)
28using (var client = new HttpClient()) 56using (var client = new HttpClient()) 90using (var client = new HttpClient())
WebSocketMiddlewareTests.cs (4)
669using (var client = new HttpClient()) 703using (var client = new HttpClient()) 752using (var client = new HttpClient()) 825using (var client = new HttpClient())
Microsoft.Build.Tasks.Core (1)
DownloadFile.cs (1)
150using (var client = new HttpClient(HttpMessageHandler ?? new HttpClientHandler(), disposeHandler: true) { Timeout = TimeSpan.FromMilliseconds(Timeout) })
Microsoft.DotNet.Arcade.Sdk (2)
src\DownloadFile.cs (2)
126using (var httpClient = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true })) 146private async Tasks.Task<bool> DownloadWithRetriesAsync(HttpClient httpClient, string uri)
Microsoft.DotNet.Build.Tasks.Feed (22)
src\AzureDevOpsNugetFeedAssetPublisher.cs (1)
29private readonly HttpClient _httpClient;
src\common\AzureStorageUtils.cs (3)
51private static readonly HttpClient s_httpClient = new HttpClient( 210HttpClient client, 242HttpClient client,
src\common\GeneralUtils.cs (2)
124HttpClient httpClient, 141HttpClient httpClient,
src\CreateAzureDevOpsFeed.cs (1)
132using (HttpClient client = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true })
src\PublishArtifactsInManifestBase.cs (15)
450using HttpClient client = CreateAzdoClient(AzureDevOpsOrg, setAutomaticDecompression: true, AzureProject); 854public HttpClient CreateAzdoClient( 873var client = new HttpClient(handler) 894public async Task<string> GetContainerIdAsync(HttpClient client, ArtifactName artifactName) 955HttpClient client, 1180using HttpClient httpClient = CreateAzdoClient(AzureDevOpsOrg, false, AzureProject); 1183using HttpClient client = CreateAzdoClient(AzureDevOpsOrg, true); 1232using HttpClient httpClient = new HttpClient(new HttpClientHandler 1282Func<TargetFeedConfig, HttpClient, T, string, string, string, Task> packagePublishAction) 1303using (HttpClient httpClient = new HttpClient(new HttpClientHandler 1365HttpClient client, 1372Func<string, string, HttpClient, MsBuildUtils.TaskLoggingHelper, Task<PackageFeedStatus>> CompareLocalPackageToFeedPackageCallBack = null, 1520using HttpClient httpClient = CreateAzdoClient(AzureDevOpsOrg, false, AzureProject); 1528using HttpClient client = CreateAzdoClient(AzureDevOpsOrg, true, AzureProject); 1632HttpClient httpClient,
Microsoft.DotNet.Build.Tasks.Feed.Tests (12)
GeneralTests.cs (4)
63using var httpClient = FakeHttpClient.WithResponses( 90using var httpClient = FakeHttpClient.WithResponses(responses); 125var httpClient = FakeHttpClient.WithResponses(response); 166var httpClient = FakeHttpClient.WithResponses(responses);
PublishArtifactsInManifestTests.cs (2)
106Func<string, string, HttpClient, MsBuildUtils.TaskLoggingHelper, Task<PackageFeedStatus>> testCompareLocalPackage = async (string localPackageFullPath, string packageContentUrl, HttpClient client, MsBuildUtils.TaskLoggingHelper log) =>
PublishToSymbolServerTest.cs (6)
244using HttpClient client = FakeHttpClient.WithResponses(response); 289using HttpClient client = FakeHttpClient.WithResponses(responses); 332using HttpClient client = FakeHttpClient.WithResponses(responses); 371using HttpClient client = FakeHttpClient.WithResponses(responses); 403using HttpClient client = FakeHttpClient.WithResponses(responses); 441using HttpClient client = FakeHttpClient.WithResponses(responses);
Microsoft.DotNet.Deployment.Tasks.Links (5)
Microsoft.DotNet.Git.IssueManager (3)
Clients\AzureDevOpsClient.cs (3)
32using (HttpClient httpClient = GetHttpClient(accountName, projectName, personalAccessToken)) 50private static HttpClient GetHttpClient(string accountName, string projectName, string personalAccessToken) 52HttpClient client = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true })
Microsoft.DotNet.Helix.Sdk (15)
AzureDevOpsTask.cs (2)
44protected abstract Task ExecuteCoreAsync(HttpClient client); 56using (var client = new HttpClient(new HttpClientHandler
CheckAzurePipelinesTestResults.cs (5)
27protected override async Task ExecuteCoreAsync(HttpClient client) 45private async Task CheckTestResultsAsync(HttpClient client) 107private async Task LogErrorsForFailedRun(HttpClient client, int testRunId) 159private async Task CheckTestResultsWithFlakySupport(HttpClient client) 201private async Task ValidateExpectedTestFailuresAsync(HttpClient client)
CreateFailedTestsForFailedWorkItems.cs (2)
20protected override async Task ExecuteCoreAsync(HttpClient client) 33private async Task<int> CreateFakeTestResultAsync(HttpClient client, string testRunId, string jobName, string workItemFriendlyName, bool failed)
FindDotNetCliPackage.cs (1)
57private static HttpClient _client;
ProvisioningProfileProvider.cs (3)
55private readonly HttpClient _httpClient; 66HttpClient httpClient, 249serviceProvider.GetRequiredService<HttpClient>(),
StartAzurePipelinesTestRun.cs (1)
28protected override Task ExecuteCoreAsync(HttpClient client)
StopAzurePipelinesTestRun.cs (1)
21protected override async Task ExecuteCoreAsync(HttpClient client)
Microsoft.DotNet.Internal.SymbolHelper (2)
SymbolPromotionHelper.cs (1)
33private static readonly HttpClient s_client = new();
SymbolUploadHelperFactory.cs (1)
24private static readonly HttpClient s_symbolDownloadClient = new();
Microsoft.DotNet.SignTool (1)
src\VerifySignatures.cs (1)
30private static readonly HttpClient client = new(new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(10) });
Microsoft.DotNet.SwaggerGenerator.CmdLine (1)
Program.cs (1)
118using (var client = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true }))
Microsoft.DotNet.SwaggerGenerator.MSBuild (1)
GenerateSwaggerCode.cs (1)
98using (var client = new HttpClient(new HttpClientHandler { CheckCertificateRevocationList = true }))
Microsoft.DotNet.VersionTools (9)
Automation\GitHubApi\GitHubClient.cs (1)
48private HttpClient _httpClient;
Automation\VstsApi\VstsAdapterClient.cs (1)
36private HttpClient _httpClient;
BuildInfo.cs (3)
34using (var client = X509Helper.GetHttpClientWithCertRevocation()) 45HttpClient client, 193HttpClient client,
Dependencies\Submodule\IndicatorPackageSubmoduleUpdater.cs (3)
23private static readonly Lazy<HttpClient> DownloadClient = new Lazy<HttpClient>(); 96HttpClient client = DownloadClient.Value;
Util\X509Helper.cs (1)
11public static HttpClient GetHttpClientWithCertRevocation()
Microsoft.Extensions.Http (174)
DefaultHttpClientFactory.cs (2)
103public HttpClient CreateClient(string name) 108var client = new HttpClient(handler, disposeHandler: false);
DefaultTypedHttpClientFactory.cs (2)
26public TClient CreateClient(HttpClient httpClient) 42return ActivatorUtilities.CreateFactory(typeof(TClient), new Type[] { typeof(HttpClient), });
DependencyInjection\HttpClientBuilderExtensions.cs (43)
23/// Adds a delegate that will be used to configure a named <see cref="HttpClient"/>. 26/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 28public static IHttpClientBuilder ConfigureHttpClient(this IHttpClientBuilder builder, Action<HttpClient> configureClient) 39/// Adds a delegate that will be used to configure a named <see cref="HttpClient"/>. 42/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 48public static IHttpClientBuilder ConfigureHttpClient(this IHttpClientBuilder builder, Action<IServiceProvider, HttpClient> configureClient) 65/// Adds a delegate that will be used to create an additional message handler for a named <see cref="HttpClient"/>. 88/// Adds a delegate that will be used to create an additional message handler for a named <see cref="HttpClient"/>. 117/// Adds an additional message handler from the dependency injection container for a named <see cref="HttpClient"/>. 145/// named <see cref="HttpClient"/>. 169/// named <see cref="HttpClient"/>. 199/// for a named <see cref="HttpClient"/>. 227/// named <see cref="HttpClient"/>. 253/// for a named <see cref="HttpClient"/>. 271/// Adds or updates <see cref="SocketsHttpHandler"/> as a primary handler for a named <see cref="HttpClient"/>. If provided, 307/// Adds or updates <see cref="SocketsHttpHandler"/> as a primary handler for a named <see cref="HttpClient"/> 336/// Configures a binding between the <typeparamref name="TClient" /> type and the named <see cref="HttpClient"/> 346/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 385HttpClient httpClient = httpClientFactory.CreateClient(builder.Name); 392/// Configures a binding between the <typeparamref name="TClient" /> type and the named <see cref="HttpClient"/> 407/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 449HttpClient httpClient = httpClientFactory.CreateClient(builder.Name); 456/// Configures a binding between the <typeparamref name="TClient" /> type and the named <see cref="HttpClient"/> 467/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 472/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder,Func{HttpClient,TClient})"/> 476public static IHttpClientBuilder AddTypedClient<TClient>(this IHttpClientBuilder builder, Func<HttpClient, TClient> factory) 485internal static IHttpClientBuilder AddTypedClientCore<TClient>(this IHttpClientBuilder builder, Func<HttpClient, TClient> factory, bool validateSingleType) 493HttpClient httpClient = httpClientFactory.CreateClient(builder.Name); 502/// Configures a binding between the <typeparamref name="TClient" /> type and the named <see cref="HttpClient"/> 513/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 518/// Calling <see cref="HttpClientBuilderExtensions.AddTypedClient{TClient}(IHttpClientBuilder,Func{HttpClient,IServiceProvider,TClient})"/> 522public static IHttpClientBuilder AddTypedClient<TClient>(this IHttpClientBuilder builder, Func<HttpClient, IServiceProvider, TClient> factory) 531internal static IHttpClientBuilder AddTypedClientCore<TClient>(this IHttpClientBuilder builder, Func<HttpClient, IServiceProvider, TClient> factory, bool validateSingleType) 542HttpClient httpClient = httpClientFactory.CreateClient(builder.Name); 612/// <see cref="HttpClient"/> instances will prevent the underlying <see cref="HttpMessageHandler"/> from being 631/// for a named <see cref="HttpClient"/>. 650/// Registers a named <see cref="HttpClient"/> and the related handler pipeline <see cref="HttpMessageHandler"/> as keyed 664/// WARNING: Registering the client as a keyed <see cref="ServiceLifetime.Transient"/> service will lead to the <see cref="HttpClient"/> and <see cref="HttpMessageHandler"/> 669/// WARNING: In case of (1) a keyed <see cref="ServiceLifetime.Singleton"/> <see cref="HttpClient"/> registration, or (2) a keyed <see cref="ServiceLifetime.Transient"/> 670/// <see cref="HttpClient"/> injected into a <see cref="ServiceLifetime.Singleton"/> service, or (3) long-running application scopes, 671/// the <see cref="HttpClient"/> instances will get captured by a singleton or a long-running scope, so they will NOT be able to participate in the handler rotation, 683/// the key <see cref="KeyedService.AnyKey"/> is used, so any named <see cref="HttpClient"/> instance will be resolvable as a keyed service (unless explicitly opted-out 718/// Removes the keyed registrations for the named <see cref="HttpClient"/> and <see cref="HttpMessageHandler"/>.
DependencyInjection\HttpClientBuilderExtensions.Logging.cs (6)
13/// Adds a delegate that will be used to create an additional logger for a named <see cref="System.Net.Http.HttpClient"/>. The custom logger would be invoked 14/// from a dedicated logging DelegatingHandler on every request of the corresponding named <see cref="System.Net.Http.HttpClient"/>. 73/// Adds a delegate that will be used to create an additional logger for a named <see cref="System.Net.Http.HttpClient"/>. The custom logger would be invoked 74/// from a dedicated logging DelegatingHandler on every request of the corresponding named <see cref="System.Net.Http.HttpClient"/>. 117/// Removes all previously added loggers for a named <see cref="System.Net.Http.HttpClient"/>, including default ones. 135/// Adds back the default logging for a named <see cref="System.Net.Http.HttpClient"/>, if it was removed previously by calling <see cref="RemoveAllLoggers"/>.
DependencyInjection\HttpClientFactoryServiceCollectionExtensions.cs (90)
75/// Adds a delegate that will be used to configure all <see cref="HttpClient"/> instances. 94/// a named <see cref="HttpClient"/>. 97/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 101/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 120/// a named <see cref="HttpClient"/>. 123/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 124/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 128/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 135public static IHttpClientBuilder AddHttpClient(this IServiceCollection services, string name, Action<HttpClient> configureClient) 150/// a named <see cref="HttpClient"/>. 153/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 154/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 158/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 165public static IHttpClientBuilder AddHttpClient(this IServiceCollection services, string name, Action<IServiceProvider, HttpClient> configureClient) 180/// a binding between the <typeparamref name="TClient"/> type and a named <see cref="HttpClient"/>. The client name 191/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 195/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 216/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. The client name will 231/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 235/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 257/// a binding between the <typeparamref name="TClient"/> type and a named <see cref="HttpClient"/>. 264/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 268/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 272/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 296/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 307/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 311/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 315/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 340/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. The client name will 348/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 352/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 356/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 362this IServiceCollection services, Action<HttpClient> configureClient) 379/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. The client name will 387/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 391/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 395/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 401this IServiceCollection services, Action<IServiceProvider, HttpClient> configureClient) 418/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. The client name will 430/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 434/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 438/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 444this IServiceCollection services, Action<HttpClient> configureClient) 462/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. The client name will 474/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 478/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 482/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 488this IServiceCollection services, Action<IServiceProvider, HttpClient> configureClient) 506/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 513/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 514/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 518/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 522/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 531this IServiceCollection services, string name, Action<HttpClient> configureClient) 548/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 555/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 556/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 560/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 564/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 573this IServiceCollection services, string name, Action<IServiceProvider, HttpClient> configureClient) 590/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 601/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 602/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 606/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 610/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 619this IServiceCollection services, string name, Action<HttpClient> configureClient) 637/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 648/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 649/// <param name="configureClient">A delegate that is used to configure an <see cref="HttpClient"/>.</param> 653/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 657/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 666this IServiceCollection services, string name, Action<IServiceProvider, HttpClient> configureClient) 684/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 698/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 702/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 707public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, Func<HttpClient, TImplementation> factory) 720/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 730/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 735/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 739/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 746public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, string name, Func<HttpClient, TImplementation> factory) 763/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 777/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 781/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 786public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, Func<HttpClient, IServiceProvider, TImplementation> factory) 799/// a binding between the <typeparamref name="TClient" /> type and a named <see cref="HttpClient"/>. 809/// <param name="name">The logical name of the <see cref="HttpClient"/> to configure.</param> 814/// <see cref="HttpClient"/> instances that apply the provided configuration can be retrieved using 818/// <typeparamref name="TClient"/> instances constructed with the appropriate <see cref="HttpClient" /> 823public static IHttpClientBuilder AddHttpClient<TClient, TImplementation>(this IServiceCollection services, string name, Func<HttpClient, IServiceProvider, TImplementation> factory)
DependencyInjection\HttpClientKeyedLifetime.cs (2)
31Client = ServiceDescriptor.DescribeKeyed(typeof(HttpClient), ServiceKey, CreateKeyedClient, lifetime); 60private static HttpClient CreateKeyedClient(IServiceProvider serviceProvider, object? key)
DependencyInjection\IHttpClientBuilder.cs (1)
9/// A builder for configuring named <see cref="HttpClient"/> instances returned by <see cref="IHttpClientFactory"/>.
DependencyInjection\ISocketsHttpHandlerBuilder.cs (1)
9/// <see cref="System.Net.Http.HttpClient"/> instances returned by <see cref="System.Net.Http.IHttpClientFactory"/>.
DependencyInjection\SocketsHttpHandlerBuilderExtensions.cs (3)
16/// <see cref="System.Net.Http.HttpClient"/> instances returned by <see cref="IHttpClientFactory"/>. 22/// named <see cref="HttpClient"/>. 48/// named <see cref="HttpClient"/>.
HttpClientFactoryExtensions.cs (3)
14/// Creates a new <see cref="HttpClient"/> using the default configuration. 17/// <returns>An <see cref="HttpClient"/> configured using the default configuration.</returns> 18public static HttpClient CreateClient(this IHttpClientFactory factory)
HttpClientFactoryOptions.cs (4)
31/// Gets a list of operations used to configure an <see cref="HttpClient"/>. 33public IList<Action<HttpClient>> HttpClientActions { get; } = new List<Action<HttpClient>>(); 55/// <see cref="HttpClient"/> instances will prevent the underlying <see cref="HttpMessageHandler"/> from being
HttpMessageHandlerBuilder.cs (3)
23/// Gets or sets the name of the <see cref="HttpClient"/> being created. 40/// <see cref="HttpClient"/> pipeline. 68/// end of the chain. The resulting pipeline is used by <see cref="IHttpClientFactory"/> infrastructure to create <see cref="HttpClient"/> instances with customized message
IHttpClientFactory.cs (8)
9/// A factory abstraction for a component that can create <see cref="HttpClient"/> instances with custom 20/// Creates and configures an <see cref="HttpClient"/> instance using the configuration that corresponds 24/// <returns>A new <see cref="HttpClient"/> instance.</returns> 27/// Each call to <see cref="CreateClient(string)"/> is guaranteed to return a new <see cref="HttpClient"/> 28/// instance. It is generally not necessary to dispose of the <see cref="HttpClient"/> as the 29/// <see cref="IHttpClientFactory"/> tracks and disposes resources used by the <see cref="HttpClient"/>. 32/// Callers are also free to mutate the returned <see cref="HttpClient"/> instance's public properties 36HttpClient CreateClient(string name);
ITypedHttpClientFactory.cs (3)
103/// Creates a typed client given an associated <see cref="HttpClient"/>. 106/// An <see cref="HttpClient"/> created by the <see cref="IHttpClientFactory"/> for the named client 110TClient CreateClient(HttpClient httpClient);
Logging\IHttpClientAsyncLogger.cs (2)
12/// An abstraction for asyncronous custom HTTP request logging for a named <see cref="HttpClient"/> instances returned by <see cref="IHttpClientFactory"/>. 17/// <see cref="HttpClient.SendAsync(HttpRequestMessage, CancellationToken)"/>), and their
Logging\IHttpClientLogger.cs (1)
10/// An abstraction for custom HTTP request logging for a named <see cref="HttpClient"/> instances returned by <see cref="IHttpClientFactory"/>.
Microsoft.Extensions.Http.Diagnostics (5)
Latency\HttpClientLatencyTelemetryOptions.cs (1)
14/// Gets or sets a value indicating whether to collect detailed latency breakdown of <see cref="HttpClient"/> call.
Logging\HttpClientLoggingHttpClientBuilderExtensions.cs (3)
23/// Adds an <see cref="IHttpClientAsyncLogger" /> to emit logs for outgoing requests for a named <see cref="HttpClient"/>. 41/// Adds an <see cref="IHttpClientAsyncLogger" /> to emit logs for outgoing requests for a named <see cref="HttpClient"/>. 61/// Adds an <see cref="IHttpClientAsyncLogger" /> to emit logs for outgoing requests for a named <see cref="HttpClient"/>.
Logging\HttpClientLoggingServiceCollectionExtensions.cs (1)
96/// Adds an enricher instance of <typeparamref name="T"/> to the <see cref="IServiceCollection"/> to enrich <see cref="HttpClient"/> logs.
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (32)
Benchmarks\HugeHttpCLientLoggingBenchmark.cs (8)
19private static readonly HttpClient _hugeNoLog 22private static readonly HttpClient _hugeLogAll 25private static readonly HttpClient _hugeLogRequest 28private static readonly HttpClient _hugeLogResponse 31private static readonly HttpClient _hugeNoLogChunked 34private static readonly HttpClient _hugeLogAllChunked 37private static readonly HttpClient _hugeLogRequestChunked 40private static readonly HttpClient _hugeLogResponseChunked
Benchmarks\MediumHttpClientLoggingBenchmark.cs (8)
19private static readonly HttpClient _mediumNoLog 22private static readonly HttpClient _mediumLogAll 25private static readonly HttpClient _mediumLogRequest 28private static readonly HttpClient _mediumLogResponse 31private static readonly HttpClient _mediumNoLogChunked 34private static readonly HttpClient _mediumLogAllChunked 37private static readonly HttpClient _mediumLogRequestChunked 40private static readonly HttpClient _mediumLogResponseChunked
Benchmarks\SmallHttpClientLoggingBenchmark.cs (8)
19private static readonly HttpClient _smallNoLog 22private static readonly HttpClient _smallLogAll 25private static readonly HttpClient _smallLogRequest 28private static readonly HttpClient _smallLogResponse 31private static readonly HttpClient _smallNoLogChunked 34private static readonly HttpClient _smallLogAllChunked 37private static readonly HttpClient _smallLogRequestChunked 40private static readonly HttpClient _smallLogResponseChunked
HttpClientFactory.cs (8)
14public static HttpClient CreateWithLoggingLogRequest(string fileName, int readLimit) 38public static HttpClient CreateWithLoggingLogResponse(string fileName, int readLimit) 61public static HttpClient CreateWithLoggingLogAll(string fileName, int readLimit) 88public static HttpClient CreateWithLoggingLogRequest_ChunkedEncoding(string fileName, int readLimit) 111public static HttpClient CreateWithLoggingLogResponse_ChunkedEncoding(string fileName, int readLimit) 134public static HttpClient CreateWithLoggingLogAll_ChunkedEncoding(string fileName, int readLimit) 161public static HttpClient CreateWithoutLogging(string fileName) 171public static HttpClient CreateWithoutLogging_ChunkedEncoding(string fileName)
Microsoft.Extensions.Http.Diagnostics.Tests (38)
Latency\HttpClientLatencyTelemetryExtensionsTest.cs (1)
66using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient();
Latency\Internal\HttpLatencyTelemetryHandlerTest.cs (1)
79using var client = new System.Net.Http.HttpClient(handler);
Logging\AcceptanceTests.cs (15)
39using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient(); 70using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient(); 106using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient("testClient"); 159using var namedClient1 = provider.GetRequiredService<IHttpClientFactory>().CreateClient("namedClient1"); 160using var namedClient2 = provider.GetRequiredService<IHttpClientFactory>().CreateClient("namedClient2"); 195private static async Task<string> SendRequest(HttpClient httpClient, HttpRequestMessage httpRequestMessage) 307using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient(); 354using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient(); 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"); 675var client = provider
Logging\HttpClientLoggerTest.cs (14)
70using var client = new HttpClient(handler); 105using var client = new HttpClient(handler); 148using var httpClient = new HttpClient(handler); 237using var client = new HttpClient(handler); 333using var client = new HttpClient(handler); 435using var client = new HttpClient(handler); 550using var client = new HttpClient(handler); 643using var client = new HttpClient(handler); 686using var client = new HttpClient(handler); 729using var client = new HttpClient(handler); 767using var client = new HttpClient(handler); 811using var client = new HttpClient(handler); 917using var client = new HttpClient(handler); 956using var client = new HttpClient(handler);
Logging\HttpClientLoggingExtensionsTest.cs (3)
307using var httpClient = provider.GetRequiredService<IHttpClientFactory>().CreateClient(); 390using var httpClient = provider.GetRequiredService<IHttpClientFactory>().CreateClient(); 403using var httpClient = sp.GetRequiredService<IHttpClientFactory>().CreateClient();
Logging\Internal\TestHttpClient1.cs (2)
11private readonly System.Net.Http.HttpClient _httpClient; 13public TestHttpClient1(System.Net.Http.HttpClient httpClient)
Logging\Internal\TestHttpClient2.cs (2)
11private readonly System.Net.Http.HttpClient _httpClient; 13public TestHttpClient2(System.Net.Http.HttpClient httpClient)
Microsoft.Extensions.Http.Polly (3)
DependencyInjection\PollyHttpClientBuilderExtensions.cs (1)
15/// and <see cref="HttpClient"/> message handler pipeline.
PolicyHttpMessageHandler.cs (2)
57/// <see cref="HttpClient.Timeout"/>. When combining Retry and Timeout, <see cref="HttpClient.Timeout"/> will act as a
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)
18private HttpClient _client = null!;
HttpResilienceBenchmark.cs (5)
17private HttpClient _client = null!; 18private HttpClient _standardClient = null!; 19private HttpClient _singleHandlerClient = null!; 20private HttpClient _hedgingClientOrdered = null!; 21private HttpClient _hedgingClientNoRoutes = null!;
RetryBenchmark.cs (2)
21private HttpClient _v7 = null!; 22private HttpClient _v8 = null!;
StandardResilienceBenchmark.cs (2)
21private HttpClient _v7 = null!; 22private HttpClient _v8 = null!;
Microsoft.Extensions.Http.Resilience.Tests (26)
Hedging\HedgingTests.cs (11)
105using var client = CreateClientWithHandler(); 122using var client = CreateClientWithHandler(); 149using var client = CreateClientWithHandler(); 171using var client = CreateClientWithHandler(); 198using var client = CreateClientWithHandler(); 222using var client = CreateClientWithHandler(); 248using var client = CreateClientWithHandler(); 275using var client = CreateClientWithHandler(); 298using var client = CreateClientWithHandler(); 309HttpClient client, HttpRequestMessage request, bool asynchronous, CancellationToken cancellationToken = default) 341protected HttpClient CreateClientWithHandler()
Hedging\StandardHedgingTests.cs (5)
222using var client = CreateClientWithHandler(); 252var client = CreateClientWithHandler(); 271var client = CreateClientWithHandler(); 287var client = CreateClientWithHandler(); 337using var client = clientFactory.CreateClient(ClientId);
Resilience\HttpClientBuilderExtensionsTests.BySelector.cs (1)
135var client = CreateClient();
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (5)
79var client = serviceProvider.GetRequiredService<IHttpClientFactory>().CreateClient("client"); 132var client = clientBuilder.Services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient("client"); 160var client = CreateClient(BuilderName); 229var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("client"); 264var client = provider.GetRequiredService<IHttpClientFactory>().CreateClient("client");
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (4)
39private static Task<HttpResponseMessage> SendRequest(HttpClient client, string url, bool asynchronous) 57private HttpClient CreateClient(string name = BuilderName) 248var client = CreateClient(); 266using var client = builder.Services.BuildServiceProvider().GetRequiredService<IHttpClientFactory>().CreateClient("test");
Microsoft.Extensions.Logging.AzureAppServices (3)
BlobAppendReferenceWrapper.cs (2)
16private readonly HttpClient _client; 19public BlobAppendReferenceWrapper(string containerUrl, string name, HttpClient client)
BlobLoggerProvider.cs (1)
24private readonly HttpClient _httpClient;
Microsoft.Extensions.ML (2)
ModelLoaders\UriModelLoader.cs (2)
107using (var client = new HttpClient()) 141using (var client = new HttpClient())
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
62var client = services.GetRequiredService<IHttpClientFactory>().CreateClient("foo");
Microsoft.ML.AutoML.Tests (1)
DatasetUtil.cs (1)
208using (var client = new HttpClient())
Microsoft.ML.Core (2)
Utilities\ResourceManagerUtils.cs (2)
157using (var client = new HttpClient()) 249private async Task<Exception> DownloadResource(IHostEnvironment env, IChannel ch, HttpClient httpClient, Uri uri, string path, string fileName, CancellationToken ct)
Microsoft.ML.PerformanceTests (1)
ImageClassificationBench.cs (1)
159using (HttpClient client = new HttpClient())
Microsoft.ML.Samples (5)
Dynamic\TensorFlow\ImageClassification.cs (1)
123using (HttpClient client = new HttpClient())
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
272using (HttpClient client = new HttpClient())
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
304using (HttpClient client = new HttpClient())
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
260using (HttpClient client = new HttpClient())
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
281using (HttpClient client = new HttpClient())
Microsoft.ML.Samples.GPU (5)
docs\samples\Microsoft.ML.Samples\Dynamic\TensorFlow\ImageClassification.cs (1)
123using (HttpClient client = new HttpClient())
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
272using (HttpClient client = new HttpClient())
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
304using (HttpClient client = new HttpClient())
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
260using (HttpClient client = new HttpClient())
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
281using (HttpClient client = new HttpClient())
Microsoft.ML.SamplesUtils (1)
SamplesDatasetUtils.cs (1)
196using (HttpClient client = new HttpClient())
Microsoft.ML.Tokenizers (2)
Utils\Helpers.netstandard.cs (2)
23public static async Task<Stream> GetStreamAsync(HttpClient client, string url, CancellationToken cancellationToken = default) 30public static Stream GetStream(HttpClient client, string url) => client.GetStreamAsync(url).GetAwaiter().GetResult();
Microsoft.ML.Tokenizers.Data.Tests (1)
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (1)
17using (var client = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) })
Microsoft.ML.Tokenizers.Tests (2)
LlamaTests.cs (1)
21private static readonly HttpClient _httpClient = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) };
Utils.cs (1)
17using (var client = new HttpClient() { Timeout = TimeSpan.FromMinutes(5) })
MyFrontend (1)
Services\CatalogServiceClient.cs (1)
5public class CatalogServiceClient(HttpClient client)
Negotiate.Client (10)
Controllers\AuthTestController.cs (10)
31var client = CreateSocketHttpClient(server); 52var client = CreateSocketHttpClient(server); 80var client = CreateWinHttpClient(server, useDefaultCredentials: true); 103var client = CreateWinHttpClient(server, useDefaultCredentials: true); 136var client = CreateWinHttpClient(server, useDefaultCredentials: true); 169var client = CreateWinHttpClient(server, useDefaultCredentials: true); 200var client = CreateWinHttpClient(server, useDefaultCredentials: true); 226var client = CreateWinHttpClient(server, useDefaultCredentials: true); 325private HttpClient CreateSocketHttpClient(string remote, bool useDefaultCredentials = false) 338private HttpClient CreateWinHttpClient(string remote, bool useDefaultCredentials = false)
netstandard (1)
netstandard.cs (1)
1123[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Http.HttpClient))]
PhotinoTestApp (1)
Program.cs (1)
18serviceCollection.AddSingleton<HttpClient>();
ServerComparison.FunctionalTests (14)
NtlmAuthenticationTest.cs (1)
48var httpClient = deploymentResult.HttpClient;
ResponseCompressionTests.cs (6)
84Func<HttpClient, ILogger, Task> scenario, 139var httpClient = deploymentResult.CreateHttpClient(httpClientHandler); 164private static async Task CheckNoCompressionAsync(HttpClient client, ILogger logger) 185private static Task CheckHostCompressionAsync(HttpClient client, ILogger logger) 190private static Task CheckAppCompressionAsync(HttpClient client, ILogger logger) 195private static async Task CheckCompressionAsync(HttpClient client, string url, ILogger logger)
ResponseTests.cs (7)
79private async Task ResponseFormats(TestVariant variant, Func<HttpClient, ILogger, Task> scenario, [CallerMemberName] string testName = null) 126private static async Task CheckContentLengthAsync(HttpClient client, ILogger logger) 151private static async Task CheckHttp11ConnectionCloseAsync(HttpClient client, ILogger logger) 171private static async Task CheckHttp10ConnectionCloseAsync(HttpClient client, ILogger logger) 196private static async Task CheckChunkedAsync(HttpClient client, ILogger logger) 221private static async Task CheckManuallyChunkedAsync(HttpClient client, ILogger logger) 246private static async Task CheckManuallyChunkedAndCloseAsync(HttpClient client, ILogger logger)
Sockets.FunctionalTests (7)
SocketTransportTests.cs (1)
51using var client = new HttpClient();
src\Servers\Kestrel\test\FunctionalTests\Http2\HandshakeTests.cs (1)
29public HttpClient Client { get; set; }
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (1)
27private HttpClient Client { get; set; }
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (2)
180using (var client = new HttpClient()) 1119using (var client = new HttpClient())
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (2)
76using (var client = new HttpClient()) 125using (var client = new HttpClient())
Stress.ApiService (1)
Program.cs (1)
85app.MapGet("/http-client-requests", async (HttpClient client) =>
Stress.AppHost (1)
ResourceBuilderExtensions.cs (1)
62var httpClient = context.ServiceProvider.GetRequiredService<IHttpClientFactory>().CreateClient();
System.Net.Http (3)
System\Net\Http\HttpProtocolException.cs (1)
13/// When calling <see cref="HttpClient"/> or <see cref="SocketsHttpHandler"/> methods, <see cref="HttpProtocolException"/> will be the inner exception of
System\Net\Http\HttpRequestError.cs (1)
67/// The response exceeded a pre-configured limit such as <see cref="HttpClient.MaxResponseContentBufferSize"/> or <see cref="HttpClientHandler.MaxResponseHeadersLength"/>.
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (1)
131_proxy = settings._proxy ?? HttpClient.DefaultProxy;
System.Net.Http.Json (66)
System\Net\Http\Json\HttpClientJsonExtensions.cs (13)
19private static Task<object?> FromJsonAsyncCore(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 24private static Task<TValue?> FromJsonAsyncCore<TValue>(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 27private static Task<object?> FromJsonAsyncCore(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 30private static Task<TValue?> FromJsonAsyncCore<TValue>(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken) => 34Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, 35HttpClient client, 74HttpClient client, 116HttpClient client, 136private static async ValueTask<Stream> GetLengthLimitReadStreamAsync(HttpClient client, ValueTask<Stream> task)
System\Net\Http\Json\HttpClientJsonExtensions.Delete.cs (13)
18private static readonly Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> s_deleteAsync = 33public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 48public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 63public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 78public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 91public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 104public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 117public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) => 130public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) => 144public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, CancellationToken cancellationToken = default) => 158public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, CancellationToken cancellationToken = default) => 172public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken = default) => 186public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Get.AsyncEnumerable.cs (9)
32this HttpClient client, 52this HttpClient client, 70this HttpClient client, 88this HttpClient client, 107this HttpClient client, 125this HttpClient client, 133HttpClient client, 144HttpClient client, 157HttpClient client,
System\Net\Http\Json\HttpClientJsonExtensions.Get.cs (13)
18private static readonly Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> s_getAsync = 23public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 28public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 33public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 38public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) => 41public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 44public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) => 47public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) => 50public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) => 55public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, CancellationToken cancellationToken = default) => 60public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, CancellationToken cancellationToken = default) => 65public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken = default) => 70public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Patch.cs (6)
27public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default) 51public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default) 74public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken) 89public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken) 103public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) 125public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System\Net\Http\Json\HttpClientJsonExtensions.Post.cs (6)
16public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default) 29public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default) 42public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken) 47public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken) 50public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) 61public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System\Net\Http\Json\HttpClientJsonExtensions.Put.cs (6)
16public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default) 29public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default) 42public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken) 47public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken) 50public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default) 61public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System.Net.Requests (6)
System\Net\HttpWebRequest.cs (5)
86private static volatile HttpClient? s_cachedHttpClient; 89private HttpClient? _httpClient; 1631private HttpClient GetCachedOrCreateHttpClient(bool async, out bool disposeRequired) 1660private static HttpClient CreateHttpClient(HttpClientParameters parameters, HttpWebRequest? request) 1662HttpClient? client = null;
System\Net\WebRequest.cs (1)
548public static IWebProxy GetSystemWebProxy() => HttpClient.DefaultProxy;
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
127Task<HttpResponseMessage> sendTask = invoker is HttpClient client
System.Private.Xml (1)
System\Xml\XmlDownloadManager.cs (1)
43using (var client = new HttpClient(handler))
System.Windows.Forms (1)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
29private static readonly HttpClient s_httpClient = !LocalAppContextSwitches.ServicePointManagerCheckCrl ? new() :
Templates.Blazor.Tests (1)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
24private readonly HttpClient _httpClient;
Templates.Blazor.WebAssembly.Auth.Tests (2)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
24private readonly HttpClient _httpClient;
src\Shared\E2ETesting\SauceConnectServer.cs (1)
148var httpClient = new HttpClient
Templates.Blazor.WebAssembly.Tests (2)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
24private readonly HttpClient _httpClient;
src\Shared\E2ETesting\SauceConnectServer.cs (1)
148var httpClient = new HttpClient
Templates.Mvc.Tests (2)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
24private readonly HttpClient _httpClient;
src\Shared\E2ETesting\SauceConnectServer.cs (1)
148var httpClient = new HttpClient
Templates.Tests (2)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
24private readonly HttpClient _httpClient;
src\Shared\E2ETesting\SauceConnectServer.cs (1)
148var httpClient = new HttpClient