常用方法
常用方法
常用方法
常用方法
public static HttpClient CreateClientWithTestAuth <T>(this WebApplicationFactory <T> factory) where T : class { var client = factory.WithTestAuthentication().CreateClient(new WebApplicationFactoryClientOptions { AllowAutoRedirect = false }); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Test"); return(client); }