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