170 instantiations of HttpResponseMessage
InMemory.FunctionalTests (1)
Microsoft.Arcade.Common (2)
Microsoft.AspNetCore.Authentication.Test (22)
Microsoft.AspNetCore.HeaderPropagation.Tests (2)
Microsoft.AspNetCore.InternalTesting (1)
Microsoft.AspNetCore.SignalR.Client.Tests (16)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
Microsoft.AspNetCore.TestHost (1)
Microsoft.AspNetCore.Testing.Tests (3)
Microsoft.Build.Tasks.UnitTests (11)
DownloadFile_Tests.cs (11)
38HttpMessageHandler = new MockHttpMessageHandler((message, token) => new HttpResponseMessage(HttpStatusCode.OK)
67HttpMessageHandler = new MockHttpMessageHandler((message, token) => new HttpResponseMessage(HttpStatusCode.OK)
92using HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK)
146HttpMessageHandler = new MockHttpMessageHandler((message, token) => new HttpResponseMessage(HttpStatusCode.OK)
186HttpMessageHandler = new MockHttpMessageHandler((message, token) => new HttpResponseMessage(HttpStatusCode.NotFound)),
210HttpMessageHandler = new MockHttpMessageHandler((message, token) => new HttpResponseMessage(HttpStatusCode.OK)
241HttpMessageHandler = new MockHttpMessageHandler((message, token) => new HttpResponseMessage(HttpStatusCode.RequestTimeout)),
290return new HttpResponseMessage(HttpStatusCode.InternalServerError);
293return new HttpResponseMessage(HttpStatusCode.OK)
323HttpMessageHandler = new MockHttpMessageHandler((message, token) => new HttpResponseMessage(HttpStatusCode.OK)
352HttpMessageHandler = new MockHttpMessageHandler((message, token) => new HttpResponseMessage(HttpStatusCode.OK)
Microsoft.DotNet.Build.Tasks.Feed.Tests (19)
Microsoft.DotNet.Helix.Sdk.Tests (16)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (2)
Microsoft.Extensions.Http.Diagnostics.Tests (34)
Microsoft.Extensions.Http.Polly.Tests (14)
Microsoft.Extensions.Http.Resilience.PerformanceTests (1)
Microsoft.Extensions.Http.Resilience.Tests (21)
System.Net.Http (3)
3684 references to HttpResponseMessage
Aspire.Dashboard.Tests (31)
Aspire.EndToEnd.Tests (3)
Aspire.Hosting (1)
Aspire.Hosting.PostgreSQL.Tests (2)
Aspire.Hosting.Redis (2)
Aspire.Hosting.Redis.Tests (5)
Aspire.Playground.Tests (2)
Aspire.Workload.Tests (2)
AuthSamples.FunctionalTests (42)
CustomPolicyProviderTests.cs (13)
28var response = await Client.GetAsync("/");
39var response = await Client.GetAsync("/Home/MinimumAge10");
51var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 20)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
54var response = await Client.GetAsync("/Home/MinimumAge10");
67var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 5)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
70var response = await Client.GetAsync("/Home/MinimumAge10");
82var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 55)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
85var response = await Client.GetAsync("/Home/MinimumAge50");
98var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 20)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
101var response = await Client.GetAsync("/Home/MinimumAge50");
113var response = await Client.GetAsync("/Home/MinimumAge50");
121internal static async Task<HttpResponseMessage> SignIn(HttpClient client, string userName, string dob)
123var goToSignIn = await client.GetAsync("/account/signin");
BasicWebSite (1)
Binding.Http.IntegrationTests (7)
Binding.ReliableSession.IntegrationTests (7)
ClientSample (2)
Diagnostics.EFCore.FunctionalTests (12)
Diagnostics.FunctionalTests (13)
dotnet-openapi (3)
dotnet-svcutil-lib (15)
GenerateRulesMissingDocumentation (1)
HeaderPropagationSample (1)
HttpClientApp (1)
HttpStress (13)
IIS.FunctionalTests (96)
IIS.LongTests (53)
IIS.Microbenchmarks (1)
IIS.NewHandler.FunctionalTests (54)
IIS.NewShim.FunctionalTests (54)
IIS.ShadowCopy.Tests (20)
IIS.Tests (2)
IISExpress.FunctionalTests (118)
Infrastructure.Common (3)
InMemory.FunctionalTests (6)
installer.tasks (1)
Interop.FunctionalTests (79)
Http3\Http3RequestTests.cs (36)
93var response1 = await client.SendAsync(request1, CancellationToken.None);
153var responseMessage = await client.SendAsync(request, CancellationToken.None).DefaultTimeout();
255var response = await client.SendAsync(request, CancellationToken.None);
306var response = await responseTask.DefaultTimeout();
341var response1 = await SendRequestAsync(protocol, host, client);
354var response2 = await SendRequestAsync(protocol, host, client);
369static async Task<HttpResponseMessage> SendRequestAsync(HttpProtocols protocol, IHost host, HttpMessageInvoker client)
387var response = await responseTask.DefaultTimeout();
432var response = await responseTask.DefaultTimeout();
632var response = await sendTask;
735var response = await responseTask.DefaultTimeout();
819var response = await client.SendAsync(request, CancellationToken.None);
855var response1 = await client.SendAsync(request1, CancellationToken.None);
866var response2 = await client.SendAsync(request2, CancellationToken.None);
915var response1 = await client.SendAsync(request1, CancellationToken.None);
928var response2 = await client.SendAsync(request2, CancellationToken.None);
944var response3 = await client.SendAsync(request3, CancellationToken.None);
1029var response = await responseTask.DefaultTimeout();
1124var response = await responseTask.DefaultTimeout();
1265var response = await responseTask.DefaultTimeout();
1321var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1374var response = await client.SendAsync(request, CancellationToken.None);
1426var response1 = await client.SendAsync(request1, CancellationToken.None);
1436var response2 = await client.SendAsync(request2, CancellationToken.None);
1493var response1 = await client.SendAsync(request1, CancellationToken.None);
1504var response2 = await client.SendAsync(request2, CancellationToken.None);
1564var response2 = await client.SendAsync(request2, CancellationToken.None);
1607var response1 = await client.SendAsync(request1, CancellationToken.None);
1667var response1 = await client.SendAsync(request1, CancellationToken.None);
1723var response1 = await client.SendAsync(request1, CancellationToken.None);
1808var response1 = await responseTask1.DefaultTimeout();
1830var response3 = await client.SendAsync(CreateHttp3Request(HttpMethod.Get, $"https://127.0.0.1:{port}/3"), CancellationToken.None);
1966var response1 = await client.SendAsync(request1, CancellationToken.None);
2053var response = await responseTask.DefaultTimeout();
2153var response = await responseTask.DefaultTimeout();
2196var response = await client.SendAsync(request, CancellationToken.None).DefaultTimeout();
HttpClientHttp2InteropTests.cs (31)
64var response = await client.GetAsync(url).DefaultTimeout();
92using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
137using var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
186using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
302var response = await responseTask;
379var response = await responseTask;
436using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
535var response = await client.GetAsync(url).DefaultTimeout();
567var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
625var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
653var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
682var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
735using var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
794using var response = await requestTask;
972var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
1013var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead).DefaultTimeout();
1064var response = await requestTask.DefaultTimeout();
1108var response = await client.GetAsync(url).DefaultTimeout();
1173var response = await requestTask.DefaultTimeout();
1226var tasks = new List<Task<HttpResponseMessage>>(10);
1234foreach (var response in responses)
1287var tasks = new List<Task<HttpResponseMessage>>(10);
1295foreach (var response in responses)
1330var response = await client.PostAsync(url, new ByteArrayContent(new byte[1024 * 18])).DefaultTimeout();
1445var response = await requestTask.DefaultTimeout();
1533var response0 = await requestTask0.DefaultTimeout();
1534var response1 = await requestTask0.DefaultTimeout();
1568var response = await client.SendAsync(request).DefaultTimeout();
1590var response = await client.GetAsync(url + " !\"$%&'()*++,-./0123456789:;<>=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`{|}~點看").DefaultTimeout();
1634var response = await client.GetAsync(url).DefaultTimeout();
1679var response = await client.GetAsync(url).DefaultTimeout();
JwtClientSample (1)
Keycloak.Web (1)
Microsoft.Arcade.Common (3)
Microsoft.Arcade.Test.Common (4)
Microsoft.AspNetCore.Authentication.Facebook (1)
Microsoft.AspNetCore.Authentication.Google (1)
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
Microsoft.AspNetCore.Authentication.OAuth (2)
Microsoft.AspNetCore.Authentication.OpenIdConnect (5)
Microsoft.AspNetCore.Authentication.Test (203)
OpenIdConnect\OpenIdConnectEventTests.cs (36)
45var response = await PostAsync(server, "signin-oidc", "");
91var response = await PostAsync(server, "signin-oidc", "");
113var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state");
162var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state");
198var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state");
221var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
272var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
302var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
326var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
379var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
410var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
434var response = await PostAsync(server, "signin-oidc", "state=protected_state&code=my_code");
487var response = await PostAsync(server, "signin-oidc", "state=protected_state&code=my_code");
518var response = await PostAsync(server, "signin-oidc", "state=protected_state&code=my_code");
543var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
598var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
630var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
661var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
728var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
776var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
798var response = await PostAsync(server, "signin-oidc", "error=access_denied&state=protected_state");
822var response = await PostAsync(server, "signin-oidc", "error=access_denied&state=protected_state");
859var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
893var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
919var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
946var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
967var response = await client.GetAsync("/");
994var response = await client.GetAsync("/");
1011var response = await client.GetAsync("/signout-oidc");
1037var response = await client.GetAsync("/signout-oidc");
1063var response = await client.GetAsync("/signout-oidc");
1080var response = await client.GetAsync("/signout-callback-oidc?state=protected_state");
1103var response = await client.GetAsync("/signout-callback-oidc?state=protected_state");
1130var response = await client.GetAsync("/signout-callback-oidc?state=protected_state");
1308private Task<HttpResponseMessage> PostAsync(TestServer server, string path, string form)
1391protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (36)
45var response = await PostAsync(server, "signin-oidc", "");
91var response = await PostAsync(server, "signin-oidc", "");
113var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state");
162var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state");
198var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state");
221var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
272var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
302var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
326var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
379var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
410var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
434var response = await PostAsync(server, "signin-oidc", "state=protected_state&code=my_code");
487var response = await PostAsync(server, "signin-oidc", "state=protected_state&code=my_code");
518var response = await PostAsync(server, "signin-oidc", "state=protected_state&code=my_code");
543var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
598var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
630var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
661var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
728var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
776var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
798var response = await PostAsync(server, "signin-oidc", "error=access_denied&state=protected_state");
822var response = await PostAsync(server, "signin-oidc", "error=access_denied&state=protected_state");
859var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
893var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
919var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
946var response = await PostAsync(server, "signin-oidc", "id_token=my_id_token&state=protected_state&code=my_code");
967var response = await client.GetAsync("/");
994var response = await client.GetAsync("/");
1011var response = await client.GetAsync("/signout-oidc");
1037var response = await client.GetAsync("/signout-oidc");
1063var response = await client.GetAsync("/signout-oidc");
1080var response = await client.GetAsync("/signout-callback-oidc?state=protected_state");
1103var response = await client.GetAsync("/signout-callback-oidc?state=protected_state");
1130var response = await client.GetAsync("/signout-callback-oidc?state=protected_state");
1306private Task<HttpResponseMessage> PostAsync(TestServer server, string path, string form)
1386protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Microsoft.AspNetCore.Authentication.Twitter (5)
Microsoft.AspNetCore.CookiePolicy.Test (1)
Microsoft.AspNetCore.Cors.Test (10)
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (31)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (21)
Microsoft.AspNetCore.Diagnostics.Tests (40)
Microsoft.AspNetCore.FunctionalTests (6)
WebHostFunctionalTests.cs (6)
39var response = await RetryHelper.RetryRequest(() => deploymentResult.HttpClient.GetAsync(string.Empty), logger, deploymentResult.HostShutdownToken, retryCount: 5);
64var response = await RetryHelper.RetryRequest(() => deploymentResult.HttpClient.GetAsync(string.Empty), logger, deploymentResult.HostShutdownToken, retryCount: 5);
91var response = await RetryHelper.RetryRequest(() => deploymentResult.HttpClient.GetAsync(string.Empty), logger, deploymentResult.HostShutdownToken);
165var response = await RetryHelper.RetryRequest(() => deploymentResult.HttpClient.GetAsync(string.Empty), Logger, deploymentResult.HostShutdownToken, retryCount: 5);
184private async Task ExecuteStartOrStartWithTest(Func<DeploymentResult, Task<HttpResponseMessage>> getResponse, string applicationName)
188var response = await RetryHelper.RetryRequest(() => getResponse(deploymentResult), logger, deploymentResult.HostShutdownToken);
Microsoft.AspNetCore.HeaderPropagation (1)
Microsoft.AspNetCore.HeaderPropagation.Tests (6)
Microsoft.AspNetCore.HostFiltering.Tests (5)
Microsoft.AspNetCore.Hosting.FunctionalTests (1)
Microsoft.AspNetCore.Http.Connections.Client (14)
Microsoft.AspNetCore.Http.Connections.Tests (5)
Microsoft.AspNetCore.Http.Extensions.Tests (2)
Microsoft.AspNetCore.HttpLogging.Tests (11)
Microsoft.AspNetCore.HttpsPolicy.Tests (17)
Microsoft.AspNetCore.Identity.FunctionalTests (137)
MapIdentityApiTests.cs (52)
110var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
143var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
180var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
211var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password });
259var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
295var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
299var refreshResponse = await client.PostAsJsonAsync("/identity/refresh", new { refreshToken });
340var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
347var refreshResponse = await client.PostAsJsonAsync("/identity/refresh", new { refreshToken });
414var refreshResponse = await client.PostAsJsonAsync("/identity/refresh", new { refreshToken });
670var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
690var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
702var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true });
728var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
734var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
743var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true });
755var recoveryLoginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] });
763var disable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { Enable = false });
780var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
786var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
798var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true });
802var resetKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { ResetSharedKey = true });
815var reenable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { TwoFactorCode = resetTwoFactorCode, Enable = true });
827var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password });
833var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
842var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true });
858var recoveryLoginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[1] });
865var updated2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
873var resetRecoveryResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { ResetRecoveryCodes = true });
896var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password });
899var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
911var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true });
920var sessionLoginResponse = await client.PostAsJsonAsync("/identity/login?useSessionCookies=true", new { Email, Password, twoFactorCode });
923var session2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
929var sessionLoginResponse2 = await client.PostAsJsonAsync("/identity/login?useCookies=true&useSessionCookies=true", new { Email, Password, twoFactorCode });
932var session2faResponse2 = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
938var persistentLoginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password, twoFactorCode });
941var persistent2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object());
1055var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { newEmail });
1132var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password });
1146var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { newEmail });
1166var emailConfirmationResponse = await client.GetAsync(GetEmailConfirmationLink(email));
1182var secondLoginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email = newEmail, Password });
1247var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { OldPassword = Password, newPassword, newEmail });
1394var loginResponse = await client.PostAsJsonAsync("/identity/login", new { email, Password });
1423private static void AssertOk(HttpResponseMessage response)
1428private static void AssertOkAndEmpty(HttpResponseMessage response)
1434private static void AssertBadRequestAndEmpty(HttpResponseMessage response)
1440private static void AssertUnauthorizedAndEmpty(HttpResponseMessage response)
1446private static async Task AssertProblemAsync(HttpResponseMessage response, string? detail, string? title = null, HttpStatusCode status = HttpStatusCode.Unauthorized)
1456private static async Task AssertValidationProblemAsync(HttpResponseMessage response, string error)
1466private static void ApplyCookies(HttpClient client, HttpResponseMessage response)
Microsoft.AspNetCore.Identity.InMemory.Test (1)
Microsoft.AspNetCore.Identity.Test (2)
Microsoft.AspNetCore.Localization.FunctionalTests (2)
Microsoft.AspNetCore.Localization.Routing.Tests (3)
Microsoft.AspNetCore.Localization.Tests (19)
Microsoft.AspNetCore.Mvc.FunctionalTests (874)
InputFormatterTests.cs (18)
48var response = await Client.PostAsync("http://localhost/Home/Index", content);
64var response = await Client.PostAsync("http://localhost/InputFormatter/ReturnInput/", content);
81var response = await Client.PostAsync("http://localhost/InputFormatter/ReturnInput/", content);
91var response = await Client.GetAsync("PolymorphicBinding/ModelBound?DerivedProperty=Test");
103var response = await Client.GetAsync("PolymorphicBinding/ModelBound");
123var response = await Client.PostAsJsonAsync("PolymorphicBinding/InputFormatted", input);
135var response = await Client.PostAsJsonAsync("PolymorphicBinding/InputFormatted", string.Empty);
155var response = await Client.PostAsJsonAsync("PolymorphicPropertyBinding/Action", input);
167var response = await Client.PostAsJsonAsync("PolymorphicPropertyBinding/Action", string.Empty);
186var response = await Client.PostAsJsonAsync<object>($"Home/{nameof(HomeController.DefaultBody)}", value: null);
204var response = await Client.PostAsJsonAsync<object>($"Home/{nameof(HomeController.NonNullableBody)}", value: null);
231var response = await Client.PostAsync($"Home/{nameof(HomeController.DefaultBody)}", content);
241var response = await Client.PostAsJsonAsync<object>($"Home/{nameof(HomeController.OptionalBody)}", value: null);
251var response = await Client.PostAsJsonAsync<object>($"Home/{nameof(HomeController.DefaultValueBody)}", value: null);
261var response = await Client.PostAsJsonAsync<object>($"Home/{nameof(HomeController.NullableBody)}", value: null);
276var response = await Client.PostAsync($"Home/{nameof(HomeController.OptionalBody)}", content);
291var response = await Client.PostAsync($"Home/{nameof(HomeController.DefaultValueBody)}", content);
306var response = await Client.PostAsync($"Home/{nameof(HomeController.NullableBody)}", content);
TempDataTestBase.cs (14)
46var response = await Client.PostAsync("/TempData/SetTempData", content);
77var response = await Client.PostAsync("/TempData/DisplayTempData", content);
96var response = await Client.PostAsync("/TempData/SetTempData", content);
102var redirectResponse = await Client.SendAsync(GetRequest("/TempData/GetTempDataAndRedirect", response));
127var response = await Client.PostAsync("/TempData/SetTempData", content);
133var peekResponse = await Client.SendAsync(GetRequest("/TempData/PeekTempData", response));
141var getResponse = await Client.SendAsync(GetRequest("/TempData/GetTempData", response));
167var redirectResponse = await Client.PostAsync("/TempData/SetTempDataMultiple", content);
173var response = await Client.SendAsync(GetRequest(redirectResponse.Headers.Location.ToString(), redirectResponse));
192var response = await Client.GetAsync("/TempData/SetTempDataResponseWrite");
206var response = await Client.GetAsync("/TempData/SetTempDataInActionResult");
230var response = await Client.GetAsync("/TempData/UnhandledExceptionAndSettingTempData");
248var response = await Client.GetAsync("/TempData/UnhandledExceptionAndSettingTempData?handleException=true");
262public HttpRequestMessage GetRequest(string path, HttpResponseMessage response)
Microsoft.AspNetCore.Mvc.Testing (8)
Microsoft.AspNetCore.OutputCaching.Tests (89)
OutputCacheTests.cs (89)
29var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
30var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
51var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
52var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "different"));
71var initialResponse = await client.PostAsync("", new StringContent(string.Empty));
72var subsequentResponse = await client.PostAsync("", new StringContent(string.Empty));
91var subsequentResponse = await client.SendAsync(new HttpRequestMessage(HttpMethod.Head, ""));
92var initialResponse = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, ""));
111var initialResponse = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, ""));
112var subsequentResponse = await client.SendAsync(new HttpRequestMessage(HttpMethod.Head, ""));
134var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
137var cachedResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
143var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
165var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
168var cachedResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
174var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
195var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "path"));
196var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "PATH"));
218var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "path"));
219var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "PATH"));
245var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
247var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
269var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
270var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
297var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
298var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
318var initialResponse = await client.GetAsync("");
319var subsequentResponse = await client.GetAsync("");
342var initialResponse = await client.GetAsync("");
344var subsequentResponse = await client.GetAsync("");
366var initialResponse = await client.GetAsync("?query=value");
367var subsequentResponse = await client.GetAsync("?query=value");
389var initialResponse = await client.GetAsync("?querya=valuea&queryb=valueb");
390var subsequentResponse = await client.GetAsync("?QueryA=valuea&QueryB=valueb");
412var initialResponse = await client.GetAsync("?querya=valuea&queryb=valueb");
413var subsequentResponse = await client.GetAsync("?QueryA=valuea&QueryB=valueb");
435var initialResponse = await client.GetAsync("?QueryA=ValueA&QueryB=ValueB");
436var subsequentResponse = await client.GetAsync("?QueryB=ValueB&QueryA=ValueA");
458var initialResponse = await client.GetAsync("?QueryA=ValueA&QueryB=ValueB");
459var subsequentResponse = await client.GetAsync("?QueryB=ValueB&QueryA=ValueA");
480var initialResponse = await client.GetAsync("?query=value");
481var subsequentResponse = await client.GetAsync("?query=value2");
503var initialResponse = await client.GetAsync("?other=value1");
504var subsequentResponse = await client.GetAsync("?other=value2");
525var initialResponse = await client.GetAsync("?querya=valuea&queryb=valueb");
526var subsequentResponse = await client.GetAsync("?querya=ValueA&queryb=ValueB");
547var initialResponse = await client.GetAsync("?querya=valuea&queryb=valueb");
548var subsequentResponse = await client.GetAsync("?querya=ValueA&queryb=ValueB");
567var initialResponse = await client.GetAsync("");
572var subsequentResponse = await client.GetAsync("");
591var initialResponse = await client.GetAsync("");
596var subsequentResponse = await client.GetAsync("/different");
616var initialResponse = await client.GetAsync("");
617var subsequentResponse = await client.GetAsync("");
636var initialResponse = await client.GetAsync("");
641var subsequentResponse = await client.GetAsync("");
664var initialResponse = await client.GetAsync("");
665var subsequentResponse = await client.GetAsync("");
684var initialResponse = await client.GetAsync("");
685var subsequentResponse = await client.GetAsync("");
710var initialResponse = await client.GetAsync("");
712var subsequentResponse = await client.GetAsync("");
733var initialResponse = await client.GetAsync("");
735var subsequentResponse = await client.GetAsync("");
759var initialResponse = await client.GetAsync("");
761var subsequentResponse = await client.GetAsync("");
782var initialResponse = await client.GetAsync("");
784var subsequentResponse = await client.GetAsync("");
809var initialResponse = await client.GetAsync("");
810var subsequentResponse = await client.GetAsync("");
832var initialResponse = await client.GetAsync("");
833var subsequentResponse = await client.GetAsync("/different");
855var initialResponse = await client.GetAsync("/path");
856var subsequentResponse = await client.GetAsync("/Path");
876var initialResponse = await client.GetAsync("");
878var otherResponse = await client.GetAsync("");
880var subsequentResponse = await client.GetAsync("");
903var initialResponse = await client.GetAsync("");
908var otherResponse = await client.GetAsync("");
913var subsequentResponse = await client.GetAsync("");
932var initialResponse = await client.SendAsync(TestUtils.CreateRequest("HEAD", "?contentLength=10"));
933var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest("HEAD", "?contentLength=10"));
1003var resp = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, ""));
1033private static void Assert304Headers(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse)
1049private static async Task AssertCachedResponseAsync(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse)
1062private static async Task AssertFreshResponseAsync(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse)
Microsoft.AspNetCore.ResponseCaching.Tests (85)
ResponseCachingTests.cs (85)
29var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
30var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
53var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
54var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "different"));
75var initialResponse = await client.PostAsync("", new StringContent(string.Empty));
76var subsequentResponse = await client.PostAsync("", new StringContent(string.Empty));
97var subsequentResponse = await client.SendAsync(new HttpRequestMessage(HttpMethod.Head, ""));
98var initialResponse = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, ""));
119var initialResponse = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, ""));
120var subsequentResponse = await client.SendAsync(new HttpRequestMessage(HttpMethod.Head, ""));
144var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
147var cachedResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
153var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
177var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
180var cachedResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
186var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
209var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "path"));
210var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, "PATH"));
233var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, "?Expires=0"));
234var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
258var initialResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
259var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest(method, ""));
281var initialResponse = await client.GetAsync("");
282var subsequentResponse = await client.GetAsync("");
304var initialResponse = await client.GetAsync("");
306var subsequentResponse = await client.GetAsync("");
327var initialResponse = await client.GetAsync("?query=value");
328var subsequentResponse = await client.GetAsync("?query=value");
349var initialResponse = await client.GetAsync("?querya=valuea&queryb=valueb");
350var subsequentResponse = await client.GetAsync("?QueryA=valuea&QueryB=valueb");
371var initialResponse = await client.GetAsync("?querya=valuea&queryb=valueb");
372var subsequentResponse = await client.GetAsync("?QueryA=valuea&QueryB=valueb");
393var initialResponse = await client.GetAsync("?QueryA=ValueA&QueryB=ValueB");
394var subsequentResponse = await client.GetAsync("?QueryB=ValueB&QueryA=ValueA");
415var initialResponse = await client.GetAsync("?QueryA=ValueA&QueryB=ValueB");
416var subsequentResponse = await client.GetAsync("?QueryB=ValueB&QueryA=ValueA");
437var initialResponse = await client.GetAsync("?query=value");
438var subsequentResponse = await client.GetAsync("?query=value2");
459var initialResponse = await client.GetAsync("?querya=valuea&queryb=valueb");
460var subsequentResponse = await client.GetAsync("?querya=ValueA&queryb=ValueB");
481var initialResponse = await client.GetAsync("?querya=valuea&queryb=valueb");
482var subsequentResponse = await client.GetAsync("?querya=ValueA&queryb=ValueB");
503var initialResponse = await client.GetAsync("");
508var subsequentResponse = await client.GetAsync("");
529var initialResponse = await client.GetAsync("");
534var subsequentResponse = await client.GetAsync("/different");
556var initialResponse = await client.GetAsync("");
557var subsequentResponse = await client.GetAsync("");
578var initialResponse = await client.GetAsync("");
583var subsequentResponse = await client.GetAsync("");
608var initialResponse = await client.GetAsync("");
609var subsequentResponse = await client.GetAsync("");
630var initialResponse = await client.GetAsync("");
631var subsequentResponse = await client.GetAsync("");
657var initialResponse = await client.GetAsync("?Expires=90");
659var subsequentResponse = await client.GetAsync("");
682var initialResponse = await client.GetAsync("");
684var subsequentResponse = await client.GetAsync("");
710var initialResponse = await client.GetAsync("?Expires=90");
712var subsequentResponse = await client.GetAsync("");
735var initialResponse = await client.GetAsync("");
737var subsequentResponse = await client.GetAsync("");
761var initialResponse = await client.GetAsync("");
762var subsequentResponse = await client.GetAsync("");
786var initialResponse = await client.GetAsync("");
787var subsequentResponse = await client.GetAsync("/different");
811var initialResponse = await client.GetAsync("/path");
812var subsequentResponse = await client.GetAsync("/Path");
834var initialResponse = await client.GetAsync("");
836var otherResponse = await client.GetAsync("");
838var subsequentResponse = await client.GetAsync("");
863var initialResponse = await client.GetAsync("");
868var otherResponse = await client.GetAsync("");
873var subsequentResponse = await client.GetAsync("");
898var initialResponse = await client.GetAsync("");
903var otherResponse = await client.GetAsync("");
908var subsequentResponse = await client.GetAsync("");
929var initialResponse = await client.SendAsync(TestUtils.CreateRequest("HEAD", "?contentLength=10"));
930var subsequentResponse = await client.SendAsync(TestUtils.CreateRequest("HEAD", "?contentLength=10"));
937private static void Assert304Headers(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse)
953private static async Task AssertCachedResponseAsync(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse)
966private static async Task AssertFreshResponseAsync(HttpResponseMessage initialResponse, HttpResponseMessage subsequentResponse)
Microsoft.AspNetCore.ResponseCompression.Tests (20)
ResponseCompressionMiddlewareTest.cs (20)
180var response = await client.SendAsync(request);
338var response = await client.SendAsync(request);
477var response = await client.SendAsync(request);
540var response = await client.SendAsync(request);
603var response = await client.SendAsync(request);
656var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
701var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
753var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
806var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
876var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
940var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1004var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1065var response = await client.SendAsync(request);
1115var response = await client.SendAsync(request);
1165var response = await client.SendAsync(request);
1215var response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead);
1230private static async Task<(HttpResponseMessage, List<WriteContext>)> InvokeMiddleware(
1284var response = await client.SendAsync(request);
1289private static void CheckResponseCompressed(HttpResponseMessage response, long? expectedBodyLength, string expectedEncoding)
1306private static void CheckResponseNotCompressed(HttpResponseMessage response, long? expectedBodyLength, bool sendVaryHeader)
Microsoft.AspNetCore.Rewrite.Tests (37)
Microsoft.AspNetCore.Routing.FunctionalTests (52)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (156)
Listener\ResponseHeaderTests.cs (22)
33Task<HttpResponseMessage> responseTask = SendRequestAsync(address);
38HttpResponseMessage response = await responseTask;
55Task<HttpResponseMessage> responseTask = SendRequestAsync(address, usehttp11: false);
60HttpResponseMessage response = await responseTask;
78Task<HttpResponseMessage> responseTask = SendHeadRequestAsync(address);
83HttpResponseMessage response = await responseTask;
106Task<HttpResponseMessage> responseTask = SendHeadRequestAsync(address, usehttp11: false);
111HttpResponseMessage response = await responseTask;
135Task<HttpResponseMessage> responseTask = SendHeadRequestAsync(address);
141HttpResponseMessage response = await responseTask;
164Task<HttpResponseMessage> responseTask = SendRequestAsync(address);
170HttpResponseMessage response = await responseTask;
187Task<HttpResponseMessage> responseTask = SendHeadRequestAsync(address);
193HttpResponseMessage response = await responseTask;
228Task<HttpResponseMessage> responseTask = SendRequestAsync(address, usehttp11: false, sendKeepAlive: true, httpClient: client);
232HttpResponseMessage response = await responseTask;
259Task<HttpResponseMessage> responseTask = SendRequestAsync(address, usehttp11: false, sendKeepAlive: true);
267HttpResponseMessage response = await responseTask;
299Task<HttpResponseMessage> responseTask = SendRequestAsync(address);
334HttpResponseMessage response = await responseTask;
339private async Task<HttpResponseMessage> SendRequestAsync(string uri, bool usehttp11 = true, bool sendKeepAlive = false, HttpClient httpClient = null)
354private async Task<HttpResponseMessage> SendHeadRequestAsync(string uri, bool usehttp11 = true)
Microsoft.AspNetCore.Server.IISIntegration.Tests (7)
Microsoft.AspNetCore.Server.IntegrationTesting (6)
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (5)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (7)
Microsoft.AspNetCore.Session.Tests (21)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (4)
Microsoft.AspNetCore.SignalR.Client.Tests (69)
LongPollingTransportTests.cs (19)
35.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
70.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
104.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
159.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
187.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
233.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
278.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
327.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
369.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
406.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
458var tcs = new TaskCompletionSource<HttpResponseMessage>();
463.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
525var pollTcs = new TaskCompletionSource<HttpResponseMessage>();
531.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
587.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
616.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
642.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
702var responseTaskCompletionSource = new TaskCompletionSource<HttpResponseMessage>();
748var response = await responseTaskCompletionSource.Task.DefaultTimeout();
ServerSentEventsTransportTests.cs (12)
31.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
72.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
125.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
175.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
230.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
273.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
304.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
362.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
389.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
412var responseTaskCompletionSource = new TaskCompletionSource<HttpResponseMessage>(TaskCreationOptions.RunContinuationsAsynchronously);
437var response = await responseTaskCompletionSource.Task.DefaultTimeout();
474.Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
TestHttpMessageHandler.cs (24)
15delegate Task<HttpResponseMessage> RequestDelegate(HttpRequestMessage requestMessage, CancellationToken cancellationToken);
77protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
135public void OnRequest(Func<HttpRequestMessage, Func<Task<HttpResponseMessage>>, CancellationToken, Task<HttpResponseMessage>> handler)
151public void OnGet(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Get, pathAndQuery, handler);
152public void OnPost(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Post, pathAndQuery, handler);
153public void OnPut(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Put, pathAndQuery, handler);
154public void OnDelete(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Delete, pathAndQuery, handler);
155public void OnHead(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Head, pathAndQuery, handler);
156public void OnOptions(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Options, pathAndQuery, handler);
157public void OnTrace(string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler) => OnRequest(HttpMethod.Trace, pathAndQuery, handler);
159public void OnRequest(HttpMethod method, string pathAndQuery, Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler)
175public void OnNegotiate(Func<HttpRequestMessage, CancellationToken, HttpResponseMessage> handler) => OnNegotiate((req, cancellationToken) => Task.FromResult(handler(req, cancellationToken)));
177public void OnNegotiate(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler)
192public void OnLongPollDelete(Func<CancellationToken, HttpResponseMessage> handler) => OnLongPollDelete((cancellationToken) => Task.FromResult(handler(cancellationToken)));
194public void OnLongPollDelete(Func<CancellationToken, Task<HttpResponseMessage>> handler)
209public void OnLongPoll(Func<CancellationToken, HttpResponseMessage> handler) => OnLongPoll(cancellationToken => Task.FromResult(handler(cancellationToken)));
211public void OnLongPoll(Func<CancellationToken, Task<HttpResponseMessage>> handler)
216public void OnLongPoll(Func<HttpRequestMessage, CancellationToken, HttpResponseMessage> handler)
221public void OnLongPoll(Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> handler)
236public void OnSocketSend(Func<byte[], CancellationToken, HttpResponseMessage> handler) => OnSocketSend((data, cancellationToken) => Task.FromResult(handler(data, cancellationToken)));
238public void OnSocketSend(Func<byte[], CancellationToken, Task<HttpResponseMessage>> handler)
254private Task<HttpResponseMessage> BaseHandler(HttpRequestMessage request, CancellationToken cancellationToken)
256return Task.FromException<HttpResponseMessage>(new InvalidOperationException($"Http endpoint not implemented: {request.Method} {request.RequestUri}"));
Microsoft.AspNetCore.SignalR.Tests (6)
Microsoft.AspNetCore.SpaProxy (2)
Microsoft.AspNetCore.SpaServices.Extensions (2)
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
Microsoft.AspNetCore.StaticAssets.Tests (44)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (7)
Microsoft.AspNetCore.StaticFiles.Tests (98)
Microsoft.AspNetCore.TestHost (10)
Microsoft.AspNetCore.TestHost.Tests (47)
Microsoft.AspNetCore.Testing.Tests (4)
Microsoft.AspNetCore.Tests (9)
Microsoft.AspNetCore.WebSockets.ConformanceTests (2)
Microsoft.AspNetCore.WebSockets.Tests (7)
Microsoft.Build.Tasks.Core (4)
Microsoft.Build.Tasks.UnitTests (4)
Microsoft.DotNet.Arcade.Sdk (1)
Microsoft.DotNet.Build.Tasks.Feed (5)
Microsoft.DotNet.Build.Tasks.Feed.Tests (3)
Microsoft.DotNet.Deployment.Tasks.Links (3)
Microsoft.DotNet.Git.IssueManager (1)
Microsoft.DotNet.Helix.Sdk (18)
Microsoft.DotNet.Internal.SymbolHelper (4)
Microsoft.DotNet.VersionTools (31)
Microsoft.Extensions.Http (23)
Logging\IHttpClientAsyncLogger.cs (3)
24/// <see cref="HttpResponseMessage"/> properties, such as reading from a content stream; if possible, such behavior should be avoided.
51ValueTask LogRequestStopAsync(object? context, HttpRequestMessage request, HttpResponseMessage response, TimeSpan elapsed, CancellationToken cancellationToken = default);
63ValueTask LogRequestFailedAsync(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed, CancellationToken cancellationToken = default);
Microsoft.Extensions.Http.Diagnostics (22)
Logging\Internal\HttpClientLogger.cs (6)
115HttpResponseMessage response,
123HttpResponseMessage? response,
132public void LogRequestStop(object? context, HttpRequestMessage request, HttpResponseMessage response, TimeSpan elapsed)
135public void LogRequestFailed(object? context, HttpRequestMessage request, HttpResponseMessage? response, Exception exception, TimeSpan elapsed)
156HttpResponseMessage? response,
224HttpRequestMessage request, HttpResponseMessage? response, Exception? exception)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (101)
Microsoft.Extensions.Http.Diagnostics.Tests (62)
Logging\HttpClientLoggerTest.cs (21)
55using var httpResponseMessage = new HttpResponseMessage { StatusCode = responseCode };
193using var httpResponseMessage = new HttpResponseMessage
287using var httpResponseMessage = new HttpResponseMessage
393using var httpResponseMessage = new HttpResponseMessage
489using var httpResponseMessage = new HttpResponseMessage
537It.IsAny<HttpResponseMessage>(),
603using var httpResponseMessage = new HttpResponseMessage
699enricher1.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
700enricher2.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
742enricher1.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
743enricher2.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
752.Setup(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()))
785enricher1.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
786enricher2.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
795.Setup(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()))
831enricher1.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
832enricher2.Verify(e => e.Enrich(It.IsAny<IEnrichmentTagCollector>(), It.IsAny<HttpRequestMessage>(), It.IsAny<HttpResponseMessage>(), It.IsAny<Exception>()), Times.Exactly(1));
873using var httpResponseMessage = new HttpResponseMessage
976.Setup(r => r.ReadResponseAsync(It.IsAny<LogRecord>(), It.IsAny<HttpResponseMessage>(), It.IsAny<List<KeyValuePair<string, string>>?>(), It.IsAny<CancellationToken>()))
983using var httpResponseMessage = new HttpResponseMessage();
1002using var httpResponseMessage = new HttpResponseMessage();
Microsoft.Extensions.Http.Polly (24)
DependencyInjection\PollyHttpClientBuilderExtensions.cs (10)
31public static IHttpClientBuilder AddPolicyHandler(this IHttpClientBuilder builder, IAsyncPolicy<HttpResponseMessage> policy)
63Func<HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector)
95Func<IServiceProvider, HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector)
144var policy = registry.Get<IAsyncPolicy<HttpResponseMessage>>(policyKey);
167Func<IReadOnlyPolicyRegistry<string>, HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector)
212/// <see cref="AddPolicyHandler(IHttpClientBuilder, IAsyncPolicy{HttpResponseMessage})"/> as desired.
217Func<PolicyBuilder<HttpResponseMessage>, IAsyncPolicy<HttpResponseMessage>> configurePolicy)
254public static IHttpClientBuilder AddPolicyHandler(this IHttpClientBuilder builder, Func<IServiceProvider, HttpRequestMessage, string, IAsyncPolicy<HttpResponseMessage>> policyFactory, Func<HttpRequestMessage, string> keySelector)
278if (registry.TryGet<IAsyncPolicy<HttpResponseMessage>>(key, out var policy))
Microsoft.Extensions.Http.Polly.Tests (56)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (23)
26NoOpPolicy = Policy.NoOpAsync<HttpResponseMessage>();
27RetryPolicy = Policy.Handle<OverflowException>().OrResult<HttpResponseMessage>(r => false).RetryAsync();
33private IAsyncPolicy<HttpResponseMessage> NoOpPolicy { get; }
36private IAsyncPolicy<HttpResponseMessage> RetryPolicy { get; }
67var response = await client.SendAsync(new HttpRequestMessage());
102var response = await client.SendAsync(new HttpRequestMessage());
140var response = await client.SendAsync(new HttpRequestMessage());
155registry.Add<IAsyncPolicy<HttpResponseMessage>>("retry", RetryPolicy);
181var response = await client.SendAsync(new HttpRequestMessage());
193registry.Add<IAsyncPolicy<HttpResponseMessage>>("noop", NoOpPolicy);
194registry.Add<IAsyncPolicy<HttpResponseMessage>>("retry", RetryPolicy);
203reg.Get<IAsyncPolicy<HttpResponseMessage>>("retry") :
204reg.Get<IAsyncPolicy<HttpResponseMessage>>("noop");
225var response = await client.SendAsync(new HttpRequestMessage());
278var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "/"));
323var response = await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "/"));
367var response = await client.SendAsync(request);
410registry.Add<IAsyncPolicy<HttpResponseMessage>>(policyName, RetryPolicy);
437var response = await client.SendAsync(new HttpRequestMessage());
561protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
578public List<Func<HttpRequestMessage, HttpResponseMessage>> Responses { get; } = new List<Func<HttpRequestMessage, HttpResponseMessage>>();
580protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
PolicyHttpMessageHandlerTest.cs (33)
22var policy = Policy<HttpResponseMessage>
29var expected = new HttpResponseMessage();
49var response = await handler.SendAsync(new HttpRequestMessage(), CancellationToken.None);
60var policy = Policy<HttpResponseMessage>
74var expected = new HttpResponseMessage();
94var response = await handler.SendAsync(expectedRequest, CancellationToken.None);
111var firstResponse = new HttpResponseMessage()
116var expected = new HttpResponseMessage();
142var response = await invoke.SendAsync(new HttpRequestMessage(), CancellationToken.None);
161var firstResponse = new HttpResponseMessage()
166var expected = new HttpResponseMessage();
194var response = await invoke.SendAsync(new HttpRequestMessage(), CancellationToken.None);
211var expected = new HttpResponseMessage();
229var policy = Policy<HttpResponseMessage>
233.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromMilliseconds(50)) // Apply a 50ms timeout
234.WrapAsync(Policy.NoOpAsync<HttpResponseMessage>()));
241var expected = new HttpResponseMessage();
264var response = await handler.SendAsync(new HttpRequestMessage(), CancellationToken.None);
275var policy = Policy.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromSeconds(10));
279var expected = new HttpResponseMessage();
291var response = await handler.SendAsync(request, CancellationToken.None);
303var policy = Policy.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromSeconds(10));
306var expected = new HttpResponseMessage();
322var response = await handler.SendAsync(request, CancellationToken.None);
355var policy = Policy.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromSeconds(10));
382var policy = Policy.TimeoutAsync<HttpResponseMessage>(TimeSpan.FromSeconds(10));
414public Func<HttpRequestMessage, Context, CancellationToken, Task<HttpResponseMessage>> OnSendAsync { get; set; }
416public TestPolicyHttpMessageHandler(IAsyncPolicy<HttpResponseMessage> policy)
421public TestPolicyHttpMessageHandler(Func<HttpRequestMessage, IAsyncPolicy<HttpResponseMessage>> policySelector)
426public new Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
431protected override Task<HttpResponseMessage> SendCoreAsync(HttpRequestMessage request, Context context, CancellationToken cancellationToken)
440public Func<HttpRequestMessage, CancellationToken, Task<HttpResponseMessage>> OnSendAsync { get; set; }
442protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Microsoft.Extensions.Http.Resilience (37)
Resilience\ResilienceHttpClientBuilderExtensions.Resilience.cs (7)
36Action<ResiliencePipelineBuilder<HttpResponseMessage>> configure)
59Action<ResiliencePipelineBuilder<HttpResponseMessage>, ResilienceHandlerContext> configure)
78private static Func<HttpRequestMessage, ResiliencePipeline<HttpResponseMessage>> CreatePipelineSelector(IServiceProvider serviceProvider, string pipelineName)
85var pipeline = resilienceProvider.GetPipeline<HttpResponseMessage>(new HttpKey(pipelineName, string.Empty));
95return resilienceProvider.GetPipeline<HttpResponseMessage>(new HttpKey(pipelineName, key));
113Action<ResiliencePipelineBuilder<HttpResponseMessage>, ResilienceHandlerContext> configure)
118_ = builder.Services.AddResiliencePipeline<HttpKey, HttpResponseMessage>(key, (builder, context) => configure(builder, new ResilienceHandlerContext(context)));
Microsoft.Extensions.Http.Resilience.PerformanceTests (22)
Microsoft.Extensions.Http.Resilience.Tests (85)
Hedging\HedgingTests.cs (11)
37private readonly Queue<HttpResponseMessage> _responses = new();
68foreach (var response in _responses)
107using var _ = await SendRequest(client, request, asynchronous, _cancellationTokenSource.Token);
127using var _ = await SendRequest(client, request, asynchronous, _cancellationTokenSource.Token);
200using var result = await SendRequest(client, request, asynchronous, _cancellationTokenSource.Token);
224using var _ = await SendRequest(client, request, asynchronous, _cancellationTokenSource.Token);
250using var _ = await SendRequest(client, request, asynchronous, _cancellationTokenSource.Token);
277using var _ = await SendRequest(client, request, asynchronous, _cancellationTokenSource.Token);
300using var result = await SendRequest(client, request, asynchronous, _cancellationTokenSource.Token);
308protected static Task<HttpResponseMessage> SendRequest(
348private Task<HttpResponseMessage> InnerHandlerFunction(HttpRequestMessage request, CancellationToken cancellationToken)
Hedging\StandardHedgingTests.cs (14)
116using var response = new HttpResponseMessage(HttpStatusCode.OK);
118var args = new HedgingActionGeneratorArguments<HttpResponseMessage>(primary, secondary, 0, _ => Outcome.FromResultAsValueTask(response));
177var primary = pipelineProvider.GetPipeline<HttpResponseMessage>(new HttpKey("clientId-standard-hedging", "instance")).GetPipelineDescriptor();
186var inner = pipelineProvider.GetPipeline<HttpResponseMessage>(new HttpKey("clientId-standard-hedging-endpoint", "instance")).GetPipelineDescriptor();
206var noPolicy = ResiliencePipeline<HttpResponseMessage>.Empty;
219provider.Setup(v => v.GetPipeline<HttpResponseMessage>(new HttpKey("clientId-standard-hedging", string.Empty))).Returns(noPolicy);
220provider.Setup(v => v.GetPipeline<HttpResponseMessage>(new HttpKey("clientId-standard-hedging-endpoint", customKey))).Returns(noPolicy);
226using var response = await SendRequest(client, request, asynchronous);
257using var _ = await SendRequest(client, firstRequest, asynchronous);
264using var __ = await SendRequest(client, secondRequest, asynchronous);
292using var _ = await SendRequest(client, request, asynchronous);
342using var _ = await SendRequest(client, request, asynchronous);
352protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
365protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)
Microsoft.Extensions.Logging.AzureAppServices (2)
Microsoft.Extensions.ML (2)
Microsoft.Extensions.ServiceDiscovery (2)
Microsoft.ML.AutoML.Tests (1)
Microsoft.ML.Core (1)
Microsoft.ML.PerformanceTests (3)
Microsoft.ML.Tokenizers (1)
Microsoft.ML.Tokenizers.Data.Tests (1)
Microsoft.ML.Tokenizers.Tests (1)
Negotiate.Client (8)
netstandard (1)
OpenIdConnectSample (1)
ServerComparison.FunctionalTests (15)
SocialSample (3)
Sockets.FunctionalTests (5)
Stress.ApiService (1)
Stress.AppHost (1)
System.Net.Http (161)
System\Net\Http\DiagnosticsHandler.cs (11)
76internal override ValueTask<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
85new ValueTask<HttpResponseMessage>(_innerHandler.SendAsync(request, cancellationToken)) :
86new ValueTask<HttpResponseMessage>(_innerHandler.Send(request, cancellationToken));
90private async ValueTask<HttpResponseMessage> SendAsyncCore(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
160HttpResponseMessage? response = null;
271internal ActivityStopData(HttpResponseMessage? response, HttpRequestMessage request, TaskStatus requestTaskStatus)
278public HttpResponseMessage? Response { get; }
329[DynamicDependency(nameof(HttpResponseMessage.StatusCode), typeof(HttpResponseMessage))]
330internal ResponseData(HttpResponseMessage? response, Guid loggingRequestId, long timestamp, TaskStatus requestTaskStatus)
338public HttpResponseMessage? Response { get; }
System\Net\Http\HttpClient.cs (41)
184HttpResponseMessage? response = null;
259HttpResponseMessage? response = null;
337HttpResponseMessage? response = null;
363public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
366public Task<HttpResponseMessage> GetAsync(Uri? requestUri) =>
369public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpCompletionOption completionOption) =>
372public Task<HttpResponseMessage> GetAsync(Uri? requestUri, HttpCompletionOption completionOption) =>
375public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
378public Task<HttpResponseMessage> GetAsync(Uri? requestUri, CancellationToken cancellationToken) =>
381public Task<HttpResponseMessage> GetAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken) =>
384public Task<HttpResponseMessage> GetAsync(Uri? requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken) =>
387public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
390public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content) =>
393public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
396public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
403public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
406public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content) =>
409public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
412public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
419public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
422public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content) =>
425public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
428public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
435public Task<HttpResponseMessage> DeleteAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri) =>
438public Task<HttpResponseMessage> DeleteAsync(Uri? requestUri) =>
441public Task<HttpResponseMessage> DeleteAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, CancellationToken cancellationToken) =>
444public Task<HttpResponseMessage> DeleteAsync(Uri? requestUri, CancellationToken cancellationToken) =>
452public HttpResponseMessage Send(HttpRequestMessage request) =>
456public HttpResponseMessage Send(HttpRequestMessage request, HttpCompletionOption completionOption) =>
460public override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken) =>
464public HttpResponseMessage Send(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
471HttpResponseMessage? response = null;
503public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request) =>
506public override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) =>
509public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption) =>
512public Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
520async Task<HttpResponseMessage> Core(
526HttpResponseMessage? response = null;
572private static void ThrowForNullResponse([NotNull] HttpResponseMessage? response)
584private void HandleFailure(Exception e, bool telemetryStarted, HttpResponseMessage? response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
645private static void FinishSend(HttpResponseMessage? response, CancellationTokenSource cts, bool disposeCts, bool telemetryStarted, bool responseContentTelemetryStarted)
System\Net\Http\Metrics\MetricsHandler.cs (6)
36internal override ValueTask<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
45new ValueTask<HttpResponseMessage>(_innerHandler.SendAsync(request, cancellationToken)) :
46new ValueTask<HttpResponseMessage>(_innerHandler.Send(request, cancellationToken));
50private async ValueTask<HttpResponseMessage> SendAsyncWithMetrics(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
53HttpResponseMessage? response = null;
97private void RequestStop(HttpRequestMessage request, HttpResponseMessage? response, Exception? exception, long startTimestamp, bool recordCurrentRequests)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs (10)
61internal static bool IsSessionAuthenticationChallenge(HttpResponseMessage response)
110private static bool TryGetAuthenticationChallenge(HttpResponseMessage response, bool isProxyAuth, Uri authUri, ICredentials credentials, out AuthenticationChallenge challenge)
131private static bool TryGetRepeatedChallenge(HttpResponseMessage response, string scheme, bool isProxyAuth, out string? challengeData)
150private static bool IsAuthenticationChallenge(HttpResponseMessage response, bool isProxyAuth)
157private static HttpHeaderValueCollection<AuthenticationHeaderValue> GetResponseAuthenticationHeaderValues(HttpResponseMessage response, bool isProxyAuth)
206private static ValueTask<HttpResponseMessage> InnerSendAsync(HttpRequestMessage request, bool async, bool isProxyAuth, bool doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
213private static async ValueTask<HttpResponseMessage> SendWithAuthAsync(HttpRequestMessage request, Uri authUri, bool async, ICredentials credentials, bool preAuthenticate, bool isProxyAuth, bool doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
241HttpResponseMessage response = await InnerSendAsync(request, async, isProxyAuth, doRequestAuth, pool, cancellationToken).ConfigureAwait(false);
348public static ValueTask<HttpResponseMessage> SendWithProxyAuthAsync(HttpRequestMessage request, Uri proxyUri, bool async, ICredentials proxyCredentials, bool doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken)
353public static ValueTask<HttpResponseMessage> SendWithRequestAuthAsync(HttpRequestMessage request, bool async, ICredentials credentials, bool preAuthenticate, HttpConnectionPool pool, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (6)
51private static Task<HttpResponseMessage> InnerSendAsync(HttpRequestMessage request, bool async, bool isProxyAuth, HttpConnectionPool pool, HttpConnection connection, CancellationToken cancellationToken)
58private static bool ProxySupportsConnectionAuth(HttpResponseMessage response)
76private static async Task<HttpResponseMessage> SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, bool async, ICredentials credentials, TokenImpersonationLevel impersonationLevel, bool isProxyAuth, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
78HttpResponseMessage response = await InnerSendAsync(request, async, isProxyAuth, connectionPool, connection, cancellationToken).ConfigureAwait(false);
235public static Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpRequestMessage request, Uri proxyUri, bool async, ICredentials proxyCredentials, TokenImpersonationLevel impersonationLevel, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
240public static Task<HttpResponseMessage> SendWithNtConnectionAuthAsync(HttpRequestMessage request, bool async, ICredentials credentials, TokenImpersonationLevel impersonationLevel, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (7)
354public ValueTask<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
373public ValueTask<HttpResponseMessage> SendWithProxyAuthAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
383private Task<HttpResponseMessage> SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
393public Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpConnection connection, HttpRequestMessage request, bool async, CancellationToken cancellationToken)
403public async ValueTask<HttpResponseMessage> SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
415HttpResponseMessage? response = null;
792HttpResponseMessage tunnelResponse = await _poolManager.SendProxyConnectAsync(tunnelRequest, _proxyUri!, async, cancellationToken).ConfigureAwait(false);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (8)
532public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
663var response = new HttpResponseMessage() { RequestMessage = request, Content = new HttpConnectionResponseContent() };
1027private bool ParseStatusLine(HttpResponseMessage response)
1056private static void ParseStatusLineCore(Span<byte> line, HttpResponseMessage response)
1129private bool ParseHeaders(HttpResponseMessage? response, bool isFromTrailer)
1148private (bool finished, int bytesConsumed) ParseHeadersCore(Span<byte> buffer, HttpResponseMessage? response, bool isFromTrailer)
1227private void AddResponseHeader(ReadOnlySpan<byte> name, ReadOnlySpan<byte> value, HttpResponseMessage response, bool isFromTrailer)
2067public async ValueTask DrainResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (4)
330public ValueTask<HttpResponseMessage> SendAsyncCore(HttpRequestMessage request, Uri? proxyUri, bool async, bool doRequestAuth, bool isProxyConnect, CancellationToken cancellationToken)
369public ValueTask<HttpResponseMessage> SendProxyConnectAsync(HttpRequestMessage request, Uri proxyUri, bool async, CancellationToken cancellationToken)
374public ValueTask<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
427private async ValueTask<HttpResponseMessage> SendAsyncMultiProxy(HttpRequestMessage request, bool async, bool doRequestAuth, MultiProxy multiProxy, Uri? firstProxy, CancellationToken cancellationToken)
System.Net.Http.Json (30)
System\Net\Http\Json\HttpClientJsonExtensions.cs (9)
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,
57Task<HttpResponseMessage> responseTask;
75Task<HttpResponseMessage> responseTask,
84using HttpResponseMessage response = await responseTask.ConfigureAwait(false);
117HttpResponseMessage response,
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)
51public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
74public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
89public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
103public static Task<HttpResponseMessage> PatchAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
125public 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)
29public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
42public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
47public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
50public static Task<HttpResponseMessage> PostAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
61public 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)
29public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonSerializerOptions? options = null, CancellationToken cancellationToken = default)
42public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, CancellationToken cancellationToken)
47public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, CancellationToken cancellationToken)
50public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
61public static Task<HttpResponseMessage> PutAsJsonAsync<TValue>(this HttpClient client, Uri? requestUri, TValue value, JsonTypeInfo<TValue> jsonTypeInfo, CancellationToken cancellationToken = default)
System.Net.Http.WinHttpHandler (1)
System.Net.Requests (6)
System.Net.WebSockets.Client (3)
Templates.Blazor.Tests (6)
Templates.Blazor.WebAssembly.Auth.Tests (6)
Templates.Blazor.WebAssembly.Tests (6)
Templates.Mvc.Tests (7)
Templates.Tests (9)