155 references to StringContent
Aspire.Hosting.PostgreSQL.Tests (1)
PostgresFunctionalTests.cs (1)
173{ new StringContent(dbName), "bookmark_id" }
Binding.Http.IntegrationTests (1)
BasicHttpBindingTests.4.0.0.cs (1)
165message.Content = new StringContent(requestMessageBody);
HttpStress (3)
Program.cs (3)
285using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri) { Version = httpVersion, Content = new StringContent(content) }) 302using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri) { Version = httpVersion, Content = new StringContent(content) }) 347using (var req = new HttpRequestMessage(HttpMethod.Put, serverUri) { Version = httpVersion, Content = new StringContent(content) })
IIS.FunctionalTests (21)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
142var response = await client.PostAsync("ReadAndWriteEchoLines", new StringContent(messages));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (5)
44var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); 64var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); 87var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBodyLarger", new StringContent(new string('a', 100000000))); 108var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBodyLarger", new StringContent(new string('a', 10000))); 154var result = await deploymentResult.HttpClient.PostAsync("/IncreaseRequestLimit", new StringContent("1"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (5)
45var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); 65var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); 88var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBodyLarger", new StringContent(new string('a', 100000000))); 109var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBodyLarger", new StringContent(new string('a', 10000))); 155var result = await deploymentResult.HttpClient.PostAsync("/IncreaseRequestLimit", new StringContent("1"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (8)
162var content = new StringContent(new string('a', 100000)); 176var content = new StringContent(body); 187var content = new StringContent(body); 198var content = new StringContent(requestBody); 209var content = new StringContent(body); 453var result = await _fixture.Client.PostAsync($"/TestReadOffsetWorks", new StringContent("Hello World")); 483var result = await _fixture.Client.PostAsync($"/TestValidReadOperations{operation}", new StringContent("hello")); 509var result = await _fixture.Client.PostAsync($"/TestValidWriteOperations/NullBufferPost", new StringContent("hello"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
44using var response = await client.PostAsync(Fixture.DeploymentResult.ApplicationBaseUri + "WebSocketNotUpgradable", new StringContent("Hello World")); 59using var response = await client.PostAsync(Fixture.DeploymentResult.ApplicationBaseUri + "WebSocketUpgradable", new StringContent(""));
IISExpress.FunctionalTests (21)
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (1)
142var response = await client.PostAsync("ReadAndWriteEchoLines", new StringContent(messages));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\MaxRequestBodySizeTests.cs (5)
44var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); 64var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); 87var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBodyLarger", new StringContent(new string('a', 100000000))); 108var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBodyLarger", new StringContent(new string('a', 10000))); 154var result = await deploymentResult.HttpClient.PostAsync("/IncreaseRequestLimit", new StringContent("1"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\MaxRequestBodySizeTests.cs (5)
45var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); 65var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBody", new StringContent("test")); 88var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBodyLarger", new StringContent(new string('a', 100000000))); 109var result = await deploymentResult.HttpClient.PostAsync("/ReadRequestBodyLarger", new StringContent(new string('a', 10000))); 155var result = await deploymentResult.HttpClient.PostAsync("/IncreaseRequestLimit", new StringContent("1"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (8)
162var content = new StringContent(new string('a', 100000)); 176var content = new StringContent(body); 187var content = new StringContent(body); 198var content = new StringContent(requestBody); 209var content = new StringContent(body); 453var result = await _fixture.Client.PostAsync($"/TestReadOffsetWorks", new StringContent("Hello World")); 483var result = await _fixture.Client.PostAsync($"/TestValidReadOperations{operation}", new StringContent("hello")); 509var result = await _fixture.Client.PostAsync($"/TestValidWriteOperations/NullBufferPost", new StringContent("hello"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (2)
44using var response = await client.PostAsync(Fixture.DeploymentResult.ApplicationBaseUri + "WebSocketNotUpgradable", new StringContent("Hello World")); 59using var response = await client.PostAsync(Fixture.DeploymentResult.ApplicationBaseUri + "WebSocketUpgradable", new StringContent(""));
Interop.FunctionalTests (2)
Http3\Http3RequestTests.cs (1)
722var requestContent = new StringContent("Hello world");
HttpClientHttp2InteropTests.cs (1)
1290var requestTask = client.PostAsync(url, new StringContent("Hello World")).DefaultTimeout();
Microsoft.Arcade.Common (1)
ArcadeHttpMessageHandler.cs (1)
34Content = new StringContent($"No response specified in RequestResponses for '({request.Method}) {request.RequestUri}")
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Logging\AcceptanceTests.cs (5)
172using var content = new StringContent(Content); 294Content = new StringContent(Content) 606using var content = new StringContent(Content); 640using var content = new StringContent(Content); 669using var content = new StringContent("Client: hello!");
Microsoft.AspNetCore.HeaderPropagation.Tests (3)
HeaderPropagationMessageHandlerTest.cs (3)
75await Client.SendAsync(new HttpRequestMessage() { Content = new StringContent("test") }); 89await Client.SendAsync(new HttpRequestMessage() { Content = new StringContent("test") }); 103await Client.SendAsync(new HttpRequestMessage() { Content = new StringContent("test") });
Microsoft.AspNetCore.Http.Extensions.Tests (17)
RequestDelegateFactoryTests.cs (2)
2055multipartFormData.Add(new StringContent("hello"), "message"); 2056multipartFormData.Add(new StringContent("foo"), "name");
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (3)
520multipartFormData.Add(new StringContent("hello"), "message"); 521multipartFormData.Add(new StringContent("foo"), "name"); 821form.Add(new StringContent("foo"), "name");
RequestDelegateGenerator\RuntimeCreationTests.ComplexFormBinding.cs (12)
57content.Add(new StringContent("1"), "Id"); 58content.Add(new StringContent("Write tests"), "Name"); 59content.Add(new StringContent("true"), "IsComplete"); 126content.Add(new StringContent("true"), "[foo]"); 127content.Add(new StringContent("false"), "[bar]"); 128content.Add(new StringContent("true"), "[baz]"); 163content.Add(new StringContent("not-a-bool"), "[foo]"); 164content.Add(new StringContent("1"), "[bar]"); 165content.Add(new StringContent("2"), "[baz]"); 235content.Add(new StringContent("1"), "[0]"); 236content.Add(new StringContent("3"), "[1]"); 237content.Add(new StringContent("5"), "[2]");
Microsoft.AspNetCore.InternalTesting.Tests (2)
HttpClientSlimTest.cs (2)
40Assert.Equal("test post", await HttpClientSlim.PostAsync(address, new StringContent("test post"))); 50() => HttpClientSlim.PostAsync(address, new StringContent("")));
Microsoft.AspNetCore.Mvc.FunctionalTests (28)
ApiBehaviorTest.cs (1)
207var response = await Client.PostAsync(url, new StringContent(string.Empty));
ApiExplorerTest.cs (5)
1328new StringContent(string.Empty)); 1359new StringContent(string.Empty)); 1394new StringContent(string.Empty)); 1429new StringContent(string.Empty)); 1510new StringContent(string.Empty));
ControllerFromServicesTests.cs (2)
81new StringContent(string.Empty)); 97new StringContent(string.Empty));
FormFileUploadTest.cs (10)
35content.Add(new StringContent("John"), "Name"); 36content.Add(new StringContent("23"), "Age"); 37content.Add(new StringContent("John's biography content"), "Biography", "Bio.txt"); 59content.Add(new StringContent("Phone"), "Name"); 60content.Add(new StringContent("camera"), "Specs[0].Key"); 61content.Add(new StringContent("camera spec1 file contents"), "Specs[0].Value", "camera_spec1.txt"); 62content.Add(new StringContent("camera spec2 file contents"), "Specs[0].Value", "camera_spec2.txt"); 63content.Add(new StringContent("battery"), "Specs[1].Key"); 64content.Add(new StringContent("battery spec1 file contents"), "Specs[1].Value", "battery_spec1.txt"); 65content.Add(new StringContent("battery spec2 file contents"), "Specs[1].Value", "battery_spec2.txt");
RazorBuildTest.cs (1)
186var response = await Client.PostAsync($"/UpdateableViews/UpdateRazorPages", new StringContent(string.Empty));
RazorPagesTest.cs (1)
1221var response = await Client.PostAsync("/Pages/Admin/Edit", new StringContent(""));
RazorPagesWithBasePathTest.cs (3)
702{ new StringContent("property1-value"), property1 }, 703{ new StringContent("test-value1"), file1, "test1.txt" }, 704{ new StringContent("test-value2"), file3, "test2.txt" }
RazorRuntimeCompilationHostingStartupTest.cs (1)
131var response = await Client.PostAsync($"/UpdateableViews/UpdateRazorPages", new StringContent(string.Empty));
SimpleWithWebApplicationBuilderTests.cs (4)
233request.Content = new StringContent("<xml />"); 248request.Content = new StringContent("<xml />"); 264content.Add(new StringContent(new string('a', 42)), "file", "file.txt"); 286content.Add(new StringContent(new string('a', 42)), "file", "file.txt");
Microsoft.AspNetCore.OutputCaching.Tests (2)
OutputCacheTests.cs (2)
71var initialResponse = await client.PostAsync("", new StringContent(string.Empty)); 72var subsequentResponse = await client.PostAsync("", new StringContent(string.Empty));
Microsoft.AspNetCore.ResponseCaching.Tests (2)
ResponseCachingTests.cs (2)
75var initialResponse = await client.PostAsync("", new StringContent(string.Empty)); 76var subsequentResponse = await client.PostAsync("", new StringContent(string.Empty));
Microsoft.AspNetCore.Routing.FunctionalTests (3)
WebHostBuilderExtensionsTest.cs (3)
37new HttpRequestMessage(HttpMethod.Post, "greeting/James") { Content = new StringContent("Biography") }, 49new HttpRequestMessage(HttpMethod.Put, "greeting/James") { Content = new StringContent("Biography") }, 67new HttpRequestMessage(HttpMethod.Post, "greeting/James") { Content = new StringContent("Biography") },
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (8)
DelegateTests.cs (1)
277var content = new StringContent("Sample request body");
HttpsTests.cs (1)
283HttpResponseMessage response = await client.PostAsync(uri, new StringContent(upload));
Listener\RequestBodyTests.cs (1)
197return SendRequestAsync(uri, new StringContent(upload));
Listener\ServerOnExistingQueueTests.cs (1)
327HttpResponseMessage response = await client.PostAsync(uri, new StringContent(upload));
OpaqueUpgradeTests.cs (1)
299request.Content = new StringContent("Hello World");
RequestBodyLimitTests.cs (1)
407return SendRequestAsync(uri, new StringContent(upload), chunked);
RequestBodyTests.cs (1)
296return SendRequestAsync(uri, new StringContent(upload));
ServerTests.cs (1)
649HttpResponseMessage response = await client.PostAsync(uri, new StringContent(upload));
Microsoft.AspNetCore.SignalR.Client.Tests (4)
ResponseUtils.cs (1)
21CreateResponse(statusCode, new StringContent(payload));
ServerSentEventsTransportTests.cs (3)
277return new HttpResponseMessage { Content = new StringContent("data: 3:abc\r\n\r\n") }; 366return new HttpResponseMessage { Content = new StringContent(string.Empty) }; 393return new HttpResponseMessage { Content = new StringContent(string.Empty) };
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaProxyTests.cs (1)
30Content = new StringContent("Test")
Microsoft.AspNetCore.TestHost.Tests (4)
ClientHandlerTests.cs (2)
361message.Content = new StringContent("Hello World"); 499message.Content = new StringContent("Hello World");
TestClientTests.cs (2)
98var content = new StringContent("Hello world"); 116var content = new StringContent("Hello world");
Microsoft.Build.Tasks.UnitTests (7)
DownloadFile_Tests.cs (7)
40Content = new StringContent(new String('!', 10000000)), 69Content = new StringContent("Success!"), 94Content = new StringContent("Success!") 148Content = new StringContent("Success!"), 295Content = new StringContent("Success!"), 325Content = new StringContent("C197675A3CC64CAA80680128CF4578C9") 354Content = new StringContent("Success!"),
Microsoft.DotNet.Helix.Sdk.Tests (8)
FindDotNetCliPackageTests.cs (8)
28ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 38ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 76ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 126ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 179ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 189ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 245ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102") } 255ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102") }
Microsoft.DotNet.VersionTools (8)
Automation\GitHubApi\GitHubClient.cs (8)
140var bodyContent = new StringContent(updateFileBody); 168var bodyContent = new StringContent(createPrBody); 210request.Content = new StringContent(JsonConvert.SerializeObject(updatePrBody)); 285var bodyContent = new StringContent(commentBody); 326var bodyContent = new StringContent(body); 351var bodyContent = new StringContent(body); 371var bodyContent = new StringContent(body); 395var bodyContent = new StringContent(body);
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\HttpHeadersReaderTest.cs (2)
131using var requestContent = new StringContent(string.Empty); 140using var responseContent = new StringContent(string.Empty);
Microsoft.Extensions.Http.Polly.Tests (1)
PolicyHttpMessageHandlerTest.cs (1)
451public FakeContent() : base("hello world")