124 references to PostAsJsonAsync
Aspire.Dashboard (6)
Telemetry\DashboardTelemetryService.cs (6)
137await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryEndOperation, new EndOperationRequest(Id: (string)propertyGetter(operationId), Result: result, ErrorMessage: errorMessage)).ConfigureAwait(false); 183await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryEndUserTask, new EndOperationRequest(Id: (string)propertyGetter(operationId), Result: result, ErrorMessage: errorMessage)).ConfigureAwait(false); 315await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryPostProperty, request).ConfigureAwait(false); 333await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryPostRecurringProperty, request).ConfigureAwait(false); 351await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryPostCommandLineFlags, request).ConfigureAwait(false); 357var httpResponseMessage = await client.PostAsJsonAsync(endpoint, request).ConfigureAwait(false);
Microsoft.AspNetCore.Identity.FunctionalTests (116)
MapIdentityApiTests.cs (116)
49AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/register", new { Email, Password })); 58AssertBadRequestAndEmpty(await client.PostAsJsonAsync("/identity/register", new { Password })); 68await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/register", new { Email = "invalid", Password }), 79AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/register", new { Email, Password })); 80await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/register", new { Email, Password }), 90await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 101await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password = "wrong" }), 113var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 146var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 183var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 214var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password }); 239=> client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password })); 262var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 298var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 302var refreshResponse = await client.PostAsJsonAsync("/identity/refresh", new { refreshToken }); 317AssertUnauthorizedAndEmpty(await client.PostAsJsonAsync("/identity/refresh", new { refreshToken })); 320AssertUnauthorizedAndEmpty(await client.PostAsJsonAsync("/identity/refresh", new { refreshToken })); 343var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 350var refreshResponse = await client.PostAsJsonAsync("/identity/refresh", new { refreshToken }); 356refreshResponse = await client.PostAsJsonAsync("/identity/refresh", new { refreshToken }); 366AssertUnauthorizedAndEmpty(await client.PostAsJsonAsync("/identity/refresh", new { refreshToken })); 372refreshResponse = await client.PostAsJsonAsync("/identity/refresh", new { refreshToken }); 396AssertUnauthorizedAndEmpty(await client.PostAsJsonAsync("/identity/refresh", new { refreshToken })); 417var refreshResponse = await client.PostAsJsonAsync("/identity/refresh", new { refreshToken }); 440await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password = "wrong" }), 443await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password = "wrong" }), 450await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 470await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password = "wrong" }), 477AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password })); 552await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 555AssertOk(await client.PostAsJsonAsync("/identity/resendConfirmationEmail", new { Email = "wrong" })); 556AssertOk(await client.PostAsJsonAsync("/identity/resendConfirmationEmail", new { Email = Email })); 565AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password })); 673var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 684await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/2fa", new { Enable = true }), 686await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/2fa", new { Enable = true, TwoFactorCode = "wrong" }), 691AssertBadRequestAndEmpty(await client.PostAsJsonAsync<object?>("/identity/manage/2fa", null)); 693var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 705var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }); 714AssertUnauthorizedAndEmpty(await client.PostAsJsonAsync("/identity/refresh", new { refreshToken })); 718await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 721AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password, twoFactorCode })); 731var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 737var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 746var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }); 755await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 758var recoveryLoginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] }); 766var disable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { Enable = false }); 772AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password })); 782var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 788var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 797await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true, ResetSharedKey = true }), 800var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }); 804var resetKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { ResetSharedKey = true }); 814await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }), 817var reenable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { TwoFactorCode = resetTwoFactorCode, Enable = true }); 829var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 835var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 844var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }); 852await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 855AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] })); 857await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] }), 860var recoveryLoginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[1] }); 867var updated2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 872await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true, ResetSharedKey = true }), 875var resetRecoveryResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { ResetRecoveryCodes = true }); 884AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = resetRecoveryCodes[0] })); 887await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[2] }), 898var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password }); 901var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 913var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }); 918await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 922var sessionLoginResponse = await client.PostAsJsonAsync("/identity/login?useSessionCookies=true", new { Email, Password, twoFactorCode }); 925var session2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 931var sessionLoginResponse2 = await client.PostAsJsonAsync("/identity/login?useCookies=true&useSessionCookies=true", new { Email, Password, twoFactorCode }); 934var session2faResponse2 = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 940var persistentLoginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password, twoFactorCode }); 943var persistent2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 977AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/forgotPassword", new { Email = confirmedEmail })); 978AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/forgotPassword", new { Email = unconfirmedEmail })); 979AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/forgotPassword", new { Email = "wrong" })); 992AssertBadRequestAndEmpty(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, resetCode })); 993AssertBadRequestAndEmpty(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = unconfirmedEmail, resetCode })); 994AssertBadRequestAndEmpty(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = "wrong", resetCode })); 996await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, ResetCode = "wrong", newPassword }), 998await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = unconfirmedEmail, ResetCode = "wrong", newPassword }), 1000await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = "wrong", ResetCode = "wrong", newPassword }), 1004await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, ResetCode = "wrong", NewPassword = "" }), 1006await AssertProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, resetCode, NewPassword = "" }), 1009AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, resetCode, newPassword })); 1012await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email = confirmedEmail, Password }), 1016AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email = confirmedEmail, Password = newPassword })); 1054await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/info", new { NewEmail = "invalid" }), 1057var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { newEmail }); 1070await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email = newEmail, Password }), 1074AssertOk(await client.PostAsJsonAsync("/identity/refresh", new { RefreshToken = originalRefreshToken })); 1096AssertUnauthorizedAndEmpty(await client.PostAsJsonAsync("/identity/refresh", new { RefreshToken = originalRefreshToken })); 1134var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password }); 1148var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { newEmail }); 1184var secondLoginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email = newEmail, Password }); 1207await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/info", new { newPassword }), 1209AssertOk(await client.PostAsJsonAsync("/identity/manage/info", new { OldPassword = Password, newPassword })); 1214await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 1216AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password = newPassword })); 1242await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/info", new { newPassword, newEmail }), 1249var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { OldPassword = Password, newPassword, newEmail }); 1257await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email = newEmail, Password = newPassword }), 1260await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 1263AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password = newPassword })); 1276AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email = newEmail, Password = newPassword })); 1295AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/register", new { Email, Password })); 1304AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password })); 1425AssertOkAndEmpty(await client.PostAsJsonAsync($"{groupPrefix}/register", new { email, Password })); 1433await client.PostAsJsonAsync($"{groupPrefix}/login", new { email, Password }); 1434var loginResponse = await client.PostAsJsonAsync("/identity/login", new { email, Password }); 1455await AssertProblemAsync(await client.PostAsJsonAsync($"{groupPrefix}/login", new { email, Password }),
Microsoft.AspNetCore.Routing.FunctionalTests (1)
RouteHandlerTest.cs (1)
52var response = await client.PostAsJsonAsync("/EchoTodo/42", todo);
System.Net.Http.Json (1)
System\Net\Http\Json\HttpClientJsonExtensions.Post.cs (1)
37=> client.PostAsJsonAsync(requestUri, value, options: null, cancellationToken);