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