共用方式為


WebApplicationFactory<TEntryPoint>.CreateDefaultClient 方法

定義

多載

CreateDefaultClient(DelegatingHandler[])

建立可用來傳送 HttpRequestMessage 至伺服器的新實例 HttpClient 。 實例的 HttpClient 基底位址將會設定為 http://localhost

CreateDefaultClient(Uri, DelegatingHandler[])

建立可用來傳送 HttpRequestMessage 至伺服器的新實例 HttpClient

CreateDefaultClient(DelegatingHandler[])

來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs

建立可用來傳送 HttpRequestMessage 至伺服器的新實例 HttpClient 。 實例的 HttpClient 基底位址將會設定為 http://localhost

public:
 System::Net::Http::HttpClient ^ CreateDefaultClient(... cli::array <System::Net::Http::DelegatingHandler ^> ^ handlers);
public System.Net.Http.HttpClient CreateDefaultClient (params System.Net.Http.DelegatingHandler[] handlers);
member this.CreateDefaultClient : System.Net.Http.DelegatingHandler[] -> System.Net.Http.HttpClient
Public Function CreateDefaultClient (ParamArray handlers As DelegatingHandler()) As HttpClient

參數

handlers
DelegatingHandler[]

要設定在 HttpClient 上的實例清單 DelegatingHandler

傳回

HttpClient

適用於

CreateDefaultClient(Uri, DelegatingHandler[])

來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs
來源:
WebApplicationFactory.cs

建立可用來傳送 HttpRequestMessage 至伺服器的新實例 HttpClient

public:
 System::Net::Http::HttpClient ^ CreateDefaultClient(Uri ^ baseAddress, ... cli::array <System::Net::Http::DelegatingHandler ^> ^ handlers);
public System.Net.Http.HttpClient CreateDefaultClient (Uri baseAddress, params System.Net.Http.DelegatingHandler[] handlers);
member this.CreateDefaultClient : Uri * System.Net.Http.DelegatingHandler[] -> System.Net.Http.HttpClient
Public Function CreateDefaultClient (baseAddress As Uri, ParamArray handlers As DelegatingHandler()) As HttpClient

參數

baseAddress
Uri

實例的 HttpClient 基底位址。

handlers
DelegatingHandler[]

要設定在 HttpClient 上的實例清單 DelegatingHandler

傳回

HttpClient

適用於