共用方式為


DistributedApplicationFactory.CreateHttpClient(String, String) Method

Definition

Creates an instance of HttpClient that is configured to route requests to the specified resource and endpoint.

public System.Net.Http.HttpClient CreateHttpClient (string resourceName, string? endpointName = default);
member this.CreateHttpClient : string * string -> System.Net.Http.HttpClient
Public Function CreateHttpClient (resourceName As String, Optional endpointName As String = Nothing) As HttpClient

Parameters

resourceName
String
endpointName
String

Returns

The HttpClient.

Applies to