183 references to new
Aspire.Dashboard.Tests (6)
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\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 (1)
288using var httpClient = new HttpClient(new HttpClientHandler
Aspire.Hosting.Tests (1)
DistributedApplicationTests.cs (1)
709using var client2 = new HttpClient(new SocketsHttpHandler
Aspire.Seq (1)
SeqHealthCheck.cs (1)
14readonly HttpClient _client = new(new SocketsHttpHandler { ActivityHeadersPropagator = null }) { BaseAddress = new Uri(seqUri) };
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
293httpClient = new HttpClient(clientHandler);
HttpClientApp (1)
Program.cs (1)
16using var client = new HttpClient(handler);
HttpStress (1)
Program.cs (1)
525using (var client = new HttpClient(handler))
IIS.FunctionalTests (9)
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\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));
IIS.LongTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1376var client = new HttpClient(handler)
IIS.NewHandler.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1376var client = new HttpClient(handler)
IIS.NewShim.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1376var client = new HttpClient(handler)
IIS.Tests (1)
Utilities\TestServer.cs (1)
116HttpClient = new HttpClient(new LoggingHandler(new SocketsHttpHandler(), _loggerFactory.CreateLogger<TestServer>()))
IISExpress.FunctionalTests (7)
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\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.LongTests\StartupTests.cs (1)
1376var client = new HttpClient(handler)
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);
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);
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.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 (1)
HttpConnectionDispatcherTests.cs (1)
3318using (var client = new HttpClient(new HttpClientHandler() { CookieContainer = cookies }))
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 (17)
AuthenticationTests.cs (1)
461using (HttpClient client = new HttpClient(handler))
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\ResponseHeaderTests.cs (1)
225using (var client = new HttpClient(handler))
ResponseHeaderTests.cs (1)
129var httpClient = new HttpClient(socketsHttpHandler);
ResponseTrailersTests.cs (1)
363using HttpClient client = new HttpClient(handler);
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\DeploymentResult.cs (1)
65new HttpClient(new LoggingHandler(_loggerFactory, baseHandler))
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.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.SpaProxy (1)
SpaProxyLaunchManager.cs (1)
96var httpClient = new HttpClient(new HttpClientHandler()
Microsoft.AspNetCore.SpaServices.Extensions (1)
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.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 (2)
ServiceFakesHostExtensions.cs (2)
49return new HttpClient(httpHandler) { BaseAddress = uri }; 55return new HttpClient(handler) { BaseAddress = uri };
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.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.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);
Negotiate.Client (2)
Controllers\AuthTestController.cs (2)
327return new HttpClient(new HttpClientHandler() 341return new HttpClient(new WinHttpHandler()
Sockets.FunctionalTests (2)
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)
System.Net.Http (1)
System\Net\Http\HttpClient.cs (1)
138public HttpClient() : this(new HttpClientHandler())
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 (1)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()
Templates.Blazor.WebAssembly.Tests (1)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()
Templates.Mvc.Tests (1)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()
Templates.Tests (1)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
44_httpClient = new HttpClient(new HttpClientHandler()