125 references to PostAsJsonAsync
Aspire.Dashboard (6)
Telemetry\DashboardTelemetryService.cs (6)
136await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryEndOperation, new EndOperationRequest(Id: (string)propertyGetter(operationId), Result: result, ErrorMessage: errorMessage)).ConfigureAwait(false); 182await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryEndUserTask, new EndOperationRequest(Id: (string)propertyGetter(operationId), Result: result, ErrorMessage: errorMessage)).ConfigureAwait(false); 314await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryPostProperty, request).ConfigureAwait(false); 332await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryPostRecurringProperty, request).ConfigureAwait(false); 350await client.PostAsJsonAsync(TelemetryEndpoints.TelemetryPostCommandLineFlags, request).ConfigureAwait(false); 356var 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 })); 783var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 789var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 798await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true, ResetSharedKey = true }), 801var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }); 805var resetKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { ResetSharedKey = true }); 815await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }), 818var reenable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { TwoFactorCode = resetTwoFactorCode, Enable = true }); 830var loginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password }); 836var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 845var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }); 853await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 856AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] })); 858await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[0] }), 861var recoveryLoginResponse = await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[1] }); 868var updated2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 873await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true, ResetSharedKey = true }), 876var resetRecoveryResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { ResetRecoveryCodes = true }); 885AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = resetRecoveryCodes[0] })); 888await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password, TwoFactorRecoveryCode = recoveryCodes[2] }), 899var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password }); 902var twoFactorKeyResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 914var enable2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new { twoFactorCode, Enable = true }); 919await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 923var sessionLoginResponse = await client.PostAsJsonAsync("/identity/login?useSessionCookies=true", new { Email, Password, twoFactorCode }); 926var session2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 932var sessionLoginResponse2 = await client.PostAsJsonAsync("/identity/login?useCookies=true&useSessionCookies=true", new { Email, Password, twoFactorCode }); 935var session2faResponse2 = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 941var persistentLoginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password, twoFactorCode }); 944var persistent2faResponse = await client.PostAsJsonAsync("/identity/manage/2fa", new object()); 978AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/forgotPassword", new { Email = confirmedEmail })); 979AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/forgotPassword", new { Email = unconfirmedEmail })); 980AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/forgotPassword", new { Email = "wrong" })); 993AssertBadRequestAndEmpty(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, resetCode })); 994AssertBadRequestAndEmpty(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = unconfirmedEmail, resetCode })); 995AssertBadRequestAndEmpty(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = "wrong", resetCode })); 997await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, ResetCode = "wrong", newPassword }), 999await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = unconfirmedEmail, ResetCode = "wrong", newPassword }), 1001await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = "wrong", ResetCode = "wrong", newPassword }), 1005await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, ResetCode = "wrong", NewPassword = "" }), 1007await AssertProblemAsync(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, resetCode, NewPassword = "" }), 1010AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/resetPassword", new { Email = confirmedEmail, resetCode, newPassword })); 1013await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email = confirmedEmail, Password }), 1017AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email = confirmedEmail, Password = newPassword })); 1055await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/info", new { NewEmail = "invalid" }), 1058var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { newEmail }); 1071await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email = newEmail, Password }), 1075AssertOk(await client.PostAsJsonAsync("/identity/refresh", new { RefreshToken = originalRefreshToken })); 1097AssertUnauthorizedAndEmpty(await client.PostAsJsonAsync("/identity/refresh", new { RefreshToken = originalRefreshToken })); 1135var loginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email, Password }); 1149var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { newEmail }); 1185var secondLoginResponse = await client.PostAsJsonAsync("/identity/login?useCookies=true", new { Email = newEmail, Password }); 1208await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/info", new { newPassword }), 1210AssertOk(await client.PostAsJsonAsync("/identity/manage/info", new { OldPassword = Password, newPassword })); 1215await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 1217AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password = newPassword })); 1243await AssertValidationProblemAsync(await client.PostAsJsonAsync("/identity/manage/info", new { newPassword, newEmail }), 1250var infoPostResponse = await client.PostAsJsonAsync("/identity/manage/info", new { OldPassword = Password, newPassword, newEmail }); 1258await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email = newEmail, Password = newPassword }), 1261await AssertProblemAsync(await client.PostAsJsonAsync("/identity/login", new { Email, Password }), 1264AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password = newPassword })); 1277AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email = newEmail, Password = newPassword })); 1296AssertOkAndEmpty(await client.PostAsJsonAsync("/identity/register", new { Email, Password })); 1305AssertOk(await client.PostAsJsonAsync("/identity/login", new { Email, Password })); 1426AssertOkAndEmpty(await client.PostAsJsonAsync($"{groupPrefix}/register", new { email, Password })); 1434await client.PostAsJsonAsync($"{groupPrefix}/login", new { email, Password }); 1435var loginResponse = await client.PostAsJsonAsync("/identity/login", new { email, Password }); 1456await 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);
Microsoft.WebTools.AspireService.Tests (1)
AspireServerServiceTests.cs (1)
246var response = await client.PostAsJsonAsync(VersionedSessionUrl, Project1SessionRequest);
System.Net.Http.Json (1)
System\Net\Http\Json\HttpClientJsonExtensions.Post.cs (1)
37=> client.PostAsJsonAsync(requestUri, value, options: null, cancellationToken);