179 references to PostAsync
Aspire.Dashboard.Tests (10)
Integration\FrontendBrowserTokenAuthTests.cs (1)
145
var response = await client.
PostAsync
("/api/validatetoken?token=" + requestToken, content: null).DefaultTimeout();
Integration\OtlpHttpServiceTests.cs (8)
47
var responseMessage = await httpClient.
PostAsync
("/v1/logs", content).DefaultTimeout();
73
var responseMessage = await httpClient.
PostAsync
("/v1/logs", content).DefaultTimeout();
117
var responseMessage = await httpClient.
PostAsync
("/v1/logs", content).DefaultTimeout();
207
var responseMessage = await httpClient.
PostAsync
("/v1/logs", content).DefaultTimeout();
237
var responseMessage = await client.
PostAsync
("/v1/logs", content).DefaultTimeout();
287
var responseMessage = await client.
PostAsync
("/v1/logs", content).DefaultTimeout();
316
var responseMessage = await client.
PostAsync
("/v1/traces", content).DefaultTimeout();
345
var responseMessage = await client.
PostAsync
("/v1/metrics", content).DefaultTimeout();
Integration\StartupTests.cs (1)
407
responseMessage = await httpClient.
PostAsync
("/v1/logs", content);
Aspire.Hosting.PostgreSQL.Tests (1)
PostgresFunctionalTests.cs (1)
178
var response = await client.
PostAsync
("/api/connect", httpContent);
Diagnostics.EFCore.FunctionalTests (6)
DatabaseErrorPageMiddlewareTest.cs (1)
300
response = await client.
PostAsync
("http://localhost" + expectedMigrationsEndpoint, formData);
MigrationsEndPointMiddlewareTest.cs (5)
126
.
PostAsync
("http://localhost" + path, formData);
161
var response = await server.CreateClient().
PostAsync
("http://localhost" + MigrationsEndPointOptions.DefaultPath, formData);
193
var response = await server.CreateClient().
PostAsync
("http://localhost" + MigrationsEndPointOptions.DefaultPath, formData);
222
var response = await server.CreateClient().
PostAsync
("http://localhost" + MigrationsEndPointOptions.DefaultPath, formData);
262
await server.CreateClient().
PostAsync
("http://localhost" + MigrationsEndPointOptions.DefaultPath, formData));
IIS.FunctionalTests (21)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
142
var response = await client.
PostAsync
("ReadAndWriteEchoLines", new StringContent(messages));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (5)
44
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBody", new StringContent("test"));
64
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBody", new StringContent("test"));
87
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBodyLarger", new StringContent(new string('a', 100000000)));
108
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBodyLarger", new StringContent(new string('a', 10000)));
154
var result = await deploymentResult.HttpClient.
PostAsync
("/IncreaseRequestLimit", new StringContent("1"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (5)
45
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBody", new StringContent("test"));
65
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBody", new StringContent("test"));
88
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBodyLarger", new StringContent(new string('a', 100000000)));
109
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBodyLarger", new StringContent(new string('a', 10000)));
155
var result = await deploymentResult.HttpClient.
PostAsync
("/IncreaseRequestLimit", new StringContent("1"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (8)
165
var response = await _fixture.Client.
PostAsync
("ReadAndWriteSynchronously", content);
177
var response = await _fixture.Client.
PostAsync
("ReadAndWriteEcho", content);
188
var response = await _fixture.Client.
PostAsync
("ReadAndWriteCopyToAsync", content);
199
var response = await _fixture.Client.
PostAsync
("ReadAndWriteEchoTwice", content);
210
var response = await _fixture.Client.
PostAsync
("SetHeaderFromBody", content);
453
var result = await _fixture.Client.
PostAsync
($"/TestReadOffsetWorks", new StringContent("Hello World"));
483
var result = await _fixture.Client.
PostAsync
($"/TestValidReadOperations{operation}", new StringContent("hello"));
509
var result = await _fixture.Client.
PostAsync
($"/TestValidWriteOperations/NullBufferPost", new StringContent("hello"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
43
using var response = await client.
PostAsync
(Fixture.DeploymentResult.ApplicationBaseUri + "WebSocketNotUpgradable", new StringContent("Hello World"));
58
using var response = await client.
PostAsync
(Fixture.DeploymentResult.ApplicationBaseUri + "WebSocketUpgradable", new StringContent(""));
IISExpress.FunctionalTests (21)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
142
var response = await client.
PostAsync
("ReadAndWriteEchoLines", new StringContent(messages));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (5)
44
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBody", new StringContent("test"));
64
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBody", new StringContent("test"));
87
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBodyLarger", new StringContent(new string('a', 100000000)));
108
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBodyLarger", new StringContent(new string('a', 10000)));
154
var result = await deploymentResult.HttpClient.
PostAsync
("/IncreaseRequestLimit", new StringContent("1"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (5)
45
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBody", new StringContent("test"));
65
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBody", new StringContent("test"));
88
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBodyLarger", new StringContent(new string('a', 100000000)));
109
var result = await deploymentResult.HttpClient.
PostAsync
("/ReadRequestBodyLarger", new StringContent(new string('a', 10000)));
155
var result = await deploymentResult.HttpClient.
PostAsync
("/IncreaseRequestLimit", new StringContent("1"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (8)
165
var response = await _fixture.Client.
PostAsync
("ReadAndWriteSynchronously", content);
177
var response = await _fixture.Client.
PostAsync
("ReadAndWriteEcho", content);
188
var response = await _fixture.Client.
PostAsync
("ReadAndWriteCopyToAsync", content);
199
var response = await _fixture.Client.
PostAsync
("ReadAndWriteEchoTwice", content);
210
var response = await _fixture.Client.
PostAsync
("SetHeaderFromBody", content);
453
var result = await _fixture.Client.
PostAsync
($"/TestReadOffsetWorks", new StringContent("Hello World"));
483
var result = await _fixture.Client.
PostAsync
($"/TestValidReadOperations{operation}", new StringContent("hello"));
509
var result = await _fixture.Client.
PostAsync
($"/TestValidWriteOperations/NullBufferPost", new StringContent("hello"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
43
using var response = await client.
PostAsync
(Fixture.DeploymentResult.ApplicationBaseUri + "WebSocketNotUpgradable", new StringContent("Hello World"));
58
using var response = await client.
PostAsync
(Fixture.DeploymentResult.ApplicationBaseUri + "WebSocketUpgradable", new StringContent(""));
Interop.FunctionalTests (5)
HttpClientHttp2InteropTests.cs (5)
1290
var requestTask = client.
PostAsync
(url, new StringContent("Hello World")).DefaultTimeout();
1330
var response = await client.
PostAsync
(url, new ByteArrayContent(new byte[1024 * 18])).DefaultTimeout();
1433
var requestTask = client.
PostAsync
(url, streamingContent);
1518
var requestTask0 = client.
PostAsync
(url, streamingContent0);
1519
var requestTask1 = client.
PostAsync
(url, streamingContent1);
Microsoft.AspNetCore.Authentication.Test (6)
OpenIdConnect\OpenIdConnectEventTests.cs (1)
1313
return client.
PostAsync
("signin-oidc",
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (1)
1311
return client.
PostAsync
("signin-oidc",
WsFederation\WsFederationTest.cs (2)
146
var exception = await Assert.ThrowsAsync<AuthenticationFailureException>(() => httpClient.
PostAsync
(httpClient.BaseAddress + "signin-wsfed", form));
156
var response = await httpClient.
PostAsync
(httpClient.BaseAddress + "signin-wsfed", form);
WsFederation\WsFederationTest_Handler.cs (2)
144
var exception = await Assert.ThrowsAsync<AuthenticationFailureException>(() => httpClient.
PostAsync
(httpClient.BaseAddress + "signin-wsfed", form));
154
var response = await httpClient.
PostAsync
(httpClient.BaseAddress + "signin-wsfed", form);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
Logging\AcceptanceTests.cs (3)
173
using var response = await client.
PostAsync
("/", content).ConfigureAwait(false);
233
using var response = await client.
PostAsync
("/", content).ConfigureAwait(false);
670
using var response = await client.
PostAsync
("/", content).ConfigureAwait(false);
Microsoft.AspNetCore.Identity.FunctionalTests (2)
MapIdentityApiTests.cs (2)
676
AssertUnauthorizedAndEmpty(await client.
PostAsync
("/identity/manage/2fa", null));
687
AssertBadRequestAndEmpty(await client.
PostAsync
("/identity/manage/2fa", null));
Microsoft.AspNetCore.Mvc.FunctionalTests (79)
AntiforgeryAuthTests.cs (3)
35
var response = await Client.
PostAsync
("http://localhost/Home/AutoAntiforgery", null);
58
var response = await Client.
PostAsync
("http://localhost/Antiforgery/Index", content: null);
68
var response = await Client.
PostAsync
("http://localhost/IgnoreAntiforgery/Index", content: null);
ApiBehaviorTest.cs (1)
207
var response = await Client.
PostAsync
(url, new StringContent(string.Empty));
ApiExplorerTest.cs (4)
1326
var response = await Client.
PostAsync
(
1357
var response = await Client.
PostAsync
(
1392
var response = await Client.
PostAsync
(
1508
var response = await Client.
PostAsync
(
AuthMiddlewareAndFilterTestBase.cs (1)
279
var response = await Client.
PostAsync
($"Login/{action}", null);
AuthMiddlewareUsingRequireAuthTest.cs (1)
81
var response = await Client.
PostAsync
($"Login/{action}", null);
BasicTests.cs (5)
404
var response = await Client.
PostAsync
("/Home/Product", new FormUrlEncodedContent(product));
536
var response = await Client.
PostAsync
("BindProperties/Action", new FormUrlEncodedContent(formContent));
559
var response = await Client.
PostAsync
("BindProperties/Action", new FormUrlEncodedContent(formContent));
581
var response = await Client.
PostAsync
("BindProperties/Action", new FormUrlEncodedContent(formContent));
601
var response = await Client.
PostAsync
("BindPropertiesSupportsGet/Action", new FormUrlEncodedContent(formContent));
ControllerFromServicesTests.cs (1)
95
var response = await Client.
PostAsync
(
GlobalAuthorizationFilterTestBase.cs (1)
64
var response = await Client.
PostAsync
("http://localhost/Administration/SignInCookie2", null);
InputFormatterTests.cs (7)
48
var response = await Client.
PostAsync
("http://localhost/Home/Index", content);
64
var response = await Client.
PostAsync
("http://localhost/InputFormatter/ReturnInput/", content);
81
var response = await Client.
PostAsync
("http://localhost/InputFormatter/ReturnInput/", content);
231
var response = await Client.
PostAsync
($"Home/{nameof(HomeController.DefaultBody)}", content);
276
var response = await Client.
PostAsync
($"Home/{nameof(HomeController.OptionalBody)}", content);
291
var response = await Client.
PostAsync
($"Home/{nameof(HomeController.DefaultValueBody)}", content);
306
var response = await Client.
PostAsync
($"Home/{nameof(HomeController.NullableBody)}", content);
InputObjectValidationTests.cs (9)
78
var response = await Client.
PostAsync
("http://localhost/Validation/Index", content);
100
var response = await Client.
PostAsync
("http://localhost/Validation/Index", content);
121
var response = await Client.
PostAsync
("http://localhost/Validation/GetDeveloperName", content);
141
var response = await Client.
PostAsync
("http://localhost/Validation/CreateProject", content);
167
var response = await Client.
PostAsync
(
192
var response = await Client.
PostAsync
("http://localhost/Validation/GetDeveloperAlias", content);
210
var response = await Client.
PostAsync
(
230
var response = await Client.
PostAsync
(
251
var response = await Client.
PostAsync
(
InputParentValidationTests.cs (2)
51
var response = await Client.
PostAsync
("http://localhost/Validation/CreateInvalidModel", content);
70
var response = await Client.
PostAsync
("http://localhost/Validation/CreateInvalidModel", content);
InputValidationTests.cs (2)
50
var response = await Client.
PostAsync
("http://localhost/TopLevelValidation", content);
85
var response = await Client.
PostAsync
("http://localhost/TopLevelValidation", content);
JsonInputFormatterTestBase.cs (5)
50
var response = await Client.
PostAsync
("http://localhost/Home/Index", content);
69
var response = await Client.
PostAsync
("http://localhost/JsonFormatter/ReturnInput/", content);
87
var response = await Client.
PostAsync
("http://localhost/JsonFormatter/ValueTypeAsBody/", content);
103
var response = await Client.
PostAsync
("http://localhost/JsonFormatter/ValueTypeAsBody/", content);
207
var response = await Client.
PostAsync
("http://localhost/JsonFormatter/ReturnInput/", content);
NewtonsoftJsonInputFormatterTest.cs (3)
19
var response = await Client.
PostAsync
("http://localhost/JsonFormatter/ReturnInput/", content);
38
var response = await Client.
PostAsync
("http://localhost/JsonFormatter/ReturnNonNullableInput/", content);
55
var response = await Client.
PostAsync
("http://localhost/JsonFormatter/ReturnInput/", content);
RazorBuildTest.cs (2)
180
var response = await Client.
PostAsync
($"/UpdateableViews/Update", updateContent);
186
var response = await Client.
PostAsync
($"/UpdateableViews/UpdateRazorPages", new StringContent(string.Empty));
RazorPagesTest.cs (1)
1221
var response = await Client.
PostAsync
("/Pages/Admin/Edit", new StringContent(""));
RazorRuntimeCompilationHostingStartupTest.cs (2)
125
var response = await Client.
PostAsync
($"/UpdateableViews/Update", updateContent);
131
var response = await Client.
PostAsync
($"/UpdateableViews/UpdateRazorPages", new StringContent(string.Empty));
RemoteAttributeValidationTest.cs (1)
99
var response = await Client.
PostAsync
(url, content);
RequestFormLimitsTest.cs (6)
48
var response = await Client.
PostAsync
(
69
var response = await Client.
PostAsync
(
95
var response = await Client.
PostAsync
(
118
var response = await Client.
PostAsync
(
144
var response = await Client.
PostAsync
(
165
var response = await Client.
PostAsync
(
RequestSizeLimitTest.cs (2)
46
var response = await Client.
PostAsync
(
68
var response = await Client.
PostAsync
(
SimpleWithWebApplicationBuilderTests.cs (2)
273
var response = await Client.
PostAsync
("/fileupload", content);
289
var response = await Client.
PostAsync
("/fileupload", content);
TagHelpersTest.cs (2)
241
var response = await Client.
PostAsync
("http://localhost/Employee/Create", postContent);
269
var response = await Client.
PostAsync
("http://localhost/Employee/Create", postContent);
TempDataInCookiesTest.cs (2)
124
var response = await Client.
PostAsync
("/TempData/SetTempData", content);
177
var response = await Client.
PostAsync
($"{protocol}://localhost/TempData/SetTempData", content);
TempDataInCookiesUsingCookieConsentTest.cs (1)
80
var response = await Client.
PostAsync
("/TempData/SetTempData", content);
TempDataPropertyTest.cs (4)
45
var redirectResponse = await Client.
PostAsync
("TempDataProperty/CreateForView", content);
73
var redirectResponse = await Client.
PostAsync
("TempDataProperty/Create", content);
102
var response = await Client.
PostAsync
("TempDataProperty/CreateNoRedirect", content);
139
var response = await Client.
PostAsync
("TempDataProperty/CreateNoRedirect", content);
TempDataTestBase.cs (5)
46
var response = await Client.
PostAsync
("/TempData/SetTempData", content);
77
var response = await Client.
PostAsync
("/TempData/DisplayTempData", content);
96
var response = await Client.
PostAsync
("/TempData/SetTempData", content);
127
var response = await Client.
PostAsync
("/TempData/SetTempData", content);
167
var redirectResponse = await Client.
PostAsync
("/TempData/SetTempDataMultiple", content);
TestingInfrastructureTests.cs (1)
160
var response = await Client.
PostAsync
(
XmlDataContractSerializerInputFormatterTest.cs (1)
43
var response = await Client.
PostAsync
("http://localhost/Home/Index", content);
XmlSerializerInputFormatterTests.cs (2)
44
var response = await Client.
PostAsync
("http://localhost/Home/Index", content);
61
var response = await Client.
PostAsync
("http://localhost/Home/Index", content);
Microsoft.AspNetCore.OutputCaching.Tests (2)
OutputCacheTests.cs (2)
71
var initialResponse = await client.
PostAsync
("", new StringContent(string.Empty));
72
var subsequentResponse = await client.
PostAsync
("", new StringContent(string.Empty));
Microsoft.AspNetCore.ResponseCaching.Tests (2)
ResponseCachingTests.cs (2)
75
var initialResponse = await client.
PostAsync
("", new StringContent(string.Empty));
76
var subsequentResponse = await client.
PostAsync
("", new StringContent(string.Empty));
Microsoft.AspNetCore.Routing.FunctionalTests (1)
MinimalFormTests.cs (1)
723
var response = await client.
PostAsync
("/", null);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (8)
DelegateTests.cs (1)
278
var response = await client.
PostAsync
(uri, content);
HttpsTests.cs (1)
291
HttpResponseMessage response = await client.
PostAsync
(uri, new StringContent(upload));
Listener\RequestBodyTests.cs (2)
178
var responseTask = client.
PostAsync
(address, content);
205
HttpResponseMessage response = await client.
PostAsync
(uri, content);
Listener\ServerOnExistingQueueTests.cs (1)
327
HttpResponseMessage response = await client.
PostAsync
(uri, new StringContent(upload));
RequestBodyLimitTests.cs (1)
415
HttpResponseMessage response = await client.
PostAsync
(uri, content);
RequestBodyTests.cs (1)
303
HttpResponseMessage response = await client.
PostAsync
(uri, content);
ServerTests.cs (1)
649
HttpResponseMessage response = await client.
PostAsync
(uri, new StringContent(upload));
Microsoft.AspNetCore.TestHost.Tests (5)
ClientHandlerTests.cs (3)
141
return httpClient.
PostAsync
("http://example.com", content);
174
return httpClient.
PostAsync
("http://example.com", new UnlimitedContent());
194
return httpClient.
PostAsync
("http://example.com", content);
TestClientTests.cs (1)
117
var response = await client.
PostAsync
("http://localhost:12345", content).DefaultTimeout();
TestServerTests.cs (1)
225
var response = await server.CreateClient().
PostAsync
("/", new StreamContent(stream));
Microsoft.DotNet.VersionTools (6)
Automation\GitHubApi\GitHubClient.cs (4)
169
using (HttpResponseMessage response = await _httpClient.
PostAsync
(pullUrl, bodyContent))
286
using (HttpResponseMessage response = await _httpClient.
PostAsync
(url, bodyContent))
327
using (HttpResponseMessage response = await _httpClient.
PostAsync
(url, bodyContent))
352
using (HttpResponseMessage response = await _httpClient.
PostAsync
(url, bodyContent))
Automation\VstsApi\VstsAdapterClient.cs (2)
135
using (HttpResponseMessage response = await _httpClient.
PostAsync
(pullUrl, bodyContent))
271
using (HttpResponseMessage response = await _httpClient.
PostAsync
(pullUrl, bodyContent))
System.Net.Http (1)
System\Net\Http\HttpClient.cs (1)
65
/// e.g.: <see cref="GetAsync(string?)" />, <see cref="
PostAsync
(string?, HttpContent)" />.