DistributedApplicationHostingTestingExtensions.CreateHttpClient Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates an HttpClient configured to communicate with the specified resource.
public static System.Net.Http.HttpClient CreateHttpClient (this Aspire.Hosting.DistributedApplication app, string resourceName, string? endpointName = default);
static member CreateHttpClient : Aspire.Hosting.DistributedApplication * string * string -> System.Net.Http.HttpClient
<Extension()>
Public Function CreateHttpClient (app As DistributedApplication, resourceName As String, Optional endpointName As String = Nothing) As HttpClient
Parameters
The application.
- resourceName
- String
The resourceName of the resource.
- endpointName
- String
The resourceName of the endpoint on the resource to communicate with.
Returns
The HttpClient.