443 instantiations of HttpClient
aspire (4)
Aspire.Acquisition.Tests (1)
Aspire.Azure.AI.Extensions.OpenAI.Tests (7)
Aspire.Azure.AI.Projects.Tests (2)
Aspire.Cli.EndToEnd.Tests (2)
Aspire.Cli.Tests (36)
Aspire.Dashboard (2)
Aspire.Dashboard.Playwright.Tests (2)
Aspire.Dashboard.Tests (31)
Aspire.Deployment.EndToEnd.Tests (6)
Aspire.Hosting (1)
Aspire.Hosting.Azure.Tests (32)
AzureSandboxesTests.cs (26)
521var client = new AzureDevComputeClient(new HttpClient(handler), credential, NullLogger.Instance);
566new HttpClient(handler),
645var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
675var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
1308var client = new AzureDevComputeClient(new HttpClient(handler), credential, NullLogger.Instance, TimeSpan.Zero);
1330new HttpClient(handler),
1382var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance, TimeSpan.Zero);
1404var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance, TimeSpan.Zero);
1424var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance, TimeSpan.Zero);
1449var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance, TimeSpan.Zero);
1470new HttpClient(handler),
1493new HttpClient(handler),
1519new HttpClient(handler),
1545new HttpClient(handler),
1568new HttpClient(handler),
1590new HttpClient(handler),
1614new HttpClient(handler),
1636var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
1658var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
1681var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
1749var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
1812var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
1863var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
1916var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
1968var client = new AzureDevComputeClient(new HttpClient(handler), new RecordingTokenCredential(), NullLogger.Instance);
3645return new HttpClient(handler, disposeHandler: false);
Aspire.Hosting.Browsers (1)
Aspire.Hosting.Browsers.Tests (1)
Aspire.Hosting.Foundry.Tests (5)
Aspire.Hosting.JavaScript.Tests (1)
Aspire.Hosting.MongoDB.Tests (4)
Aspire.Hosting.Seq.Tests (1)
Aspire.Hosting.Testing.Tests (4)
Aspire.Hosting.Tests (4)
Aspire.Playground.Tests (1)
Aspire.Seq (1)
Aspire.Templates.Tests (1)
BlazorStandalone (1)
dotnet-aot (2)
dotnet-openapi (1)
dotnet-sourcelink (1)
dotnet-svcutil-lib (1)
GenerateDocumentationAndConfigFiles (1)
Infrastructure.Common (3)
installer.tasks (1)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
Microsoft.AspNetCore.Authentication.OAuth (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
Microsoft.AspNetCore.Authentication.Twitter (1)
Microsoft.AspNetCore.Authentication.WsFederation (1)
Microsoft.AspNetCore.Components.Testing (2)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Mvc.Testing (2)
Microsoft.AspNetCore.Server.IntegrationTesting (2)
Microsoft.AspNetCore.SpaProxy (1)
Microsoft.AspNetCore.SpaServices.Extensions (2)
Microsoft.AspNetCore.TestHost (1)
Microsoft.AspNetCore.Testing (3)
Microsoft.AspNetCore.Testing.Tests (1)
Microsoft.AspNetCore.Watch.BrowserRefresh (1)
Microsoft.Build.Tasks.Core (1)
Microsoft.Deployment.DotNet.Releases (1)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.Cli.InternalMicrosoft (2)
Microsoft.DotNet.Cli.Telemetry (2)
Microsoft.Extensions.AI.Evaluation.Safety (1)
Microsoft.Extensions.AI.OpenAI.Tests (198)
Microsoft.Extensions.DataIngestion.Tests (1)
Microsoft.Extensions.Http (1)
Microsoft.Extensions.Http.Diagnostics.Tests (17)
Microsoft.Extensions.Logging.AzureAppServices (1)
Microsoft.Extensions.ML (2)
Microsoft.Maui.Controls (1)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Core (1)
Microsoft.ML.PerformanceTests (1)
Microsoft.ML.Samples (5)
Microsoft.ML.Samples.GPU (5)
Microsoft.ML.SamplesUtils (1)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.ML.Tokenizers.Data.Tests (1)
Microsoft.ML.Tokenizers.Tests (2)
Microsoft.NET.Build.Containers (1)
Microsoft.NET.Sdk.Publish.Tasks (3)
Microsoft.TemplateSearch.Common (1)
NuGet.Packaging (1)
NuGet.Protocol (1)
Pipelines.Library (1)
System.Net.Requests (1)
System.Private.Xml (1)
System.ServiceModel.Http (1)
System.Windows.Forms (2)
1152 references to HttpClient
aspire (44)
Commands\TelemetryLogsCommand.cs (3)
127using var client = TelemetryCommandHelpers.CreateApiClient(_httpClientFactory, apiToken);
166private async Task<int> GetLogsSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
188private async Task<int> StreamLogsAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
Commands\TelemetrySpansCommand.cs (3)
118using var client = TelemetryCommandHelpers.CreateApiClient(_httpClientFactory, apiToken);
161private async Task<int> GetSpansSnapshotAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
183private async Task<int> StreamSpansAsync(HttpClient client, string url, OutputFormat format, IReadOnlyList<IOtlpResource> allResources, string dashboardUrl, CancellationToken cancellationToken)
Aspire.Acquisition.Tests (1)
Aspire.Azure.AI.Extensions.OpenAI.Tests (7)
Aspire.Azure.AI.Projects.Tests (2)
Aspire.Cli.EndToEnd.Tests (2)
Aspire.Cli.Tests (39)
Aspire.Dashboard (7)
Aspire.Dashboard.Playwright.Tests (2)
Aspire.Dashboard.Tests (70)
Aspire.Deployment.EndToEnd.Tests (17)
AzureEntraIdDeploymentTests.cs (10)
37using var client = new HttpClient();
195HttpClient client, TokenCredential credential, string subscriptionId, string resourceGroupName,
235HttpClient client, TokenCredential credential, string url, Func<JsonElement, bool> predicate,
253private static async Task CleanupDirectoryAsync(HttpClient client, TokenCredential credential, string applicationUrl)
279HttpClient client, TokenCredential credential, string resourceGroupUrl, string applicationUrl)
308private static async Task CleanupResourceGroupAsync(HttpClient client, TokenCredential credential, string resourceGroupUrl)
316HttpClient client, TokenCredential credential, string url, CancellationToken cancellationToken)
330private static async Task DeleteResourceAsync(HttpClient client, TokenCredential credential, string url, CancellationToken cancellationToken)
340HttpClient client, TokenCredential credential, string url, CancellationToken cancellationToken)
354HttpClient client, TokenCredential credential, HttpMethod method, string url, CancellationToken cancellationToken)
Aspire.EndToEnd.Tests (3)
Aspire.Hosting (21)
ExternalServiceBuilderExtensions.cs (7)
345public static async Task<HealthCheckResult> CheckUriAsync(Uri uri, int expectedStatusCode, Func<HttpClient> httpClientFactory, HealthCheckContext context, CancellationToken cancellationToken)
372private readonly Func<HttpClient> _httpClientFactory;
374public StaticUriHealthCheck(Uri uri, int expectedStatusCode, Func<HttpClient> httpClientFactory)
393private readonly Func<HttpClient> _httpClientFactory;
397public ParameterUriHealthCheck(ParameterResource urlParameter, string? path, int expectedStatusCode, Func<HttpClient> httpClientFactory)
459private readonly Func<HttpClient> _httpClientFactory;
461public EndpointUriHealthCheck(EndpointReference endpoint, string path, int expectedStatusCode, Func<HttpClient> httpClientFactory)
Aspire.Hosting.Azure (1)
Aspire.Hosting.Azure.Sandboxes (1)
Aspire.Hosting.Azure.Tests (9)
Aspire.Hosting.Blazor.Tests (1)
Aspire.Hosting.Browsers (1)
Aspire.Hosting.Browsers.Tests (1)
Aspire.Hosting.Containers.Tests (6)
Aspire.Hosting.Foundry (6)
Aspire.Hosting.Foundry.Tests (5)
Aspire.Hosting.JavaScript.Tests (11)
Aspire.Hosting.MongoDB.Tests (4)
Aspire.Hosting.OpenAI (3)
Aspire.Hosting.PostgreSQL.Tests (2)
Aspire.Hosting.Redis.Tests (7)
Aspire.Hosting.Seq.Tests (6)
Aspire.Hosting.Testing (7)
Aspire.Hosting.Testing.Tests (15)
TestingBuilderTests.cs (6)
207var httpClient = app.CreateHttpClientWithResilience("mywebapp1", null, opts =>
267var httpClient = app.CreateHttpClientWithResilience("mywebapp1", null, opts =>
306var httpClient = app.CreateHttpClientWithResilience("mywebapp1", null, opts =>
350var httpClient = app.CreateHttpClientWithResilience("mywebapp1", null, opts =>
401var httpClient = app.CreateHttpClientWithResilience("mywebapp1", null, opts =>
452var httpClient = app.CreateHttpClientWithResilience("mywebapp1", "https", opts =>
Aspire.Hosting.Tests (24)
Aspire.Hosting.Yarp.Tests (1)
Aspire.Playground.Tests (17)
Aspire.Seq (1)
Aspire.Templates.Tests (4)
AzureFunctionsEndToEnd.ApiService (1)
DevTunnels.ApiService (1)
dotnet-aot (2)
dotnet-openapi (2)
dotnet-sourcelink (2)
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;
DotnetProject.WorkerService (1)
GenerateDocumentationAndConfigFiles (1)
Infrastructure.Common (3)
installer.tasks (2)
Keycloak.Web (1)
Microsoft.AspNetCore.Authentication (1)
Microsoft.AspNetCore.Authentication.JwtBearer (1)
Microsoft.AspNetCore.Authentication.OAuth (4)
Microsoft.AspNetCore.Authentication.OpenIdConnect (3)
Microsoft.AspNetCore.Authentication.Twitter (1)
Microsoft.AspNetCore.Components.Testing (3)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Microsoft.AspNetCore.HeaderPropagation (7)
Microsoft.AspNetCore.Http.Connections.Client (13)
Microsoft.AspNetCore.Mvc.Testing (33)
Microsoft.AspNetCore.Server.IntegrationTesting (6)
Microsoft.AspNetCore.SpaProxy (5)
Microsoft.AspNetCore.SpaServices.Extensions (5)
Microsoft.AspNetCore.TestHost (4)
Microsoft.AspNetCore.Testing (3)
Microsoft.AspNetCore.Testing.Tests (7)
Microsoft.AspNetCore.Watch.BrowserRefresh (1)
Microsoft.Build.Tasks.Core (1)
Microsoft.Deployment.DotNet.Releases (1)
Microsoft.DotNet.Arcade.Sdk (2)
Microsoft.DotNet.Cli.InternalMicrosoft (1)
Microsoft.DotNet.Cli.Telemetry (4)
Microsoft.Extensions.AI.Evaluation.Safety (6)
Microsoft.Extensions.AI.OpenAI.Tests (207)
Microsoft.Extensions.DataIngestion.Tests (1)
Microsoft.Extensions.Http (174)
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\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)
Microsoft.Extensions.Http.Diagnostics (8)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (32)
Microsoft.Extensions.Http.Diagnostics.Tests (44)
Microsoft.Extensions.Http.Polly (3)
Microsoft.Extensions.Http.Resilience.PerformanceTests (10)
Microsoft.Extensions.Http.Resilience.Tests (26)
Microsoft.Extensions.Logging.AzureAppServices (3)
Microsoft.Extensions.ML (2)
Microsoft.Extensions.ServiceDiscovery.Tests (1)
Microsoft.Maui.Controls (2)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Core (2)
Microsoft.ML.PerformanceTests (1)
Microsoft.ML.Samples (5)
Microsoft.ML.Samples.GPU (5)
Microsoft.ML.SamplesUtils (1)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.ML.Tokenizers (2)
Microsoft.ML.Tokenizers.Data.Tests (1)
Microsoft.ML.Tokenizers.Tests (4)
Microsoft.NET.Build.Containers (9)
Microsoft.NET.Sdk.Publish.Tasks (3)
Microsoft.TemplateSearch.Common (1)
MyFrontend (1)
netstandard (1)
NuGet.Packaging (1)
NuGet.Protocol (8)
Pipelines.Library (1)
Publishers.Frontend (1)
StandardService (1)
Stress.ApiService (1)
System.Net.Http (4)
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,
73HttpClient client,
115HttpClient client,
135private 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.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)
48public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
68public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
83public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
97public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
116public 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)
26public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
36public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
41public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
44public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
52public 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)
26public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
36public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
41public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
44public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
52public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System.Net.Requests (6)
System.Private.Xml (1)
System.ServiceModel.Http (14)
System.Windows.Forms (1)
WaitFor.Frontend (1)
Yarp.Frontend (1)