1 type derived from StringContent
Microsoft.Extensions.Http.Polly.Tests (1)
PolicyHttpMessageHandlerTest.cs (1)
449private class FakeContent : StringContent
294 instantiations of 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.Authentication.Test (22)
FacebookTests.cs (3)
337res.Content = new StringContent(graphResponse, Encoding.UTF8); 346res.Content = new StringContent(graphResponse, Encoding.UTF8); 482res.Content = new StringContent(text, Encoding.UTF8, "application/json");
GoogleTests.cs (1)
1126res.Content = new StringContent(text, Encoding.UTF8, "application/json");
MicrosoftAccountTests.cs (1)
429res.Content = new StringContent(text, Encoding.UTF8, "application/json");
OAuthTests.cs (1)
537res.Content = new StringContent(text, Encoding.UTF8, "application/json");
OpenIdConnect\OpenIdConnectChallengeTests.cs (3)
979new StringContent("{ \"id_token\": \"my_id_token\", \"access_token\": \"my_access_token\" }", Encoding.ASCII, "application/json") 984return new HttpResponseMessage() { Content = new StringContent("{ }", Encoding.ASCII, "application/json") }; 994return new HttpResponseMessage() { Content = new StringContent("{ \"request_uri\": \"my_reference_value\", \"expires_in\": 60}", Encoding.ASCII, "application/json") };
OpenIdConnect\OpenIdConnectEventTests.cs (3)
1314new StringContent(form, Encoding.ASCII, "application/x-www-form-urlencoded")); 1398new StringContent("{ \"id_token\": \"my_id_token\", \"access_token\": \"my_access_token\" }", Encoding.ASCII, "application/json") 1403return Task.FromResult(new HttpResponseMessage() { Content = new StringContent("{ }", Encoding.ASCII, "application/json") });
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (3)
1312new StringContent(form, Encoding.ASCII, "application/x-www-form-urlencoded")); 1393new StringContent("{ \"id_token\": \"my_id_token\", \"access_token\": \"my_access_token\" }", Encoding.ASCII, "application/json") 1398return Task.FromResult(new HttpResponseMessage() { Content = new StringContent("{ }", Encoding.ASCII, "application/json") });
OpenIdConnect\TestSettings.cs (1)
339var content = new StringContent(body, Encoding.UTF8, "application/json");
TwitterTests.cs (4)
486res.Content = new StringContent(graphResponse, Encoding.UTF8); 599new StringContent("oauth_callback_confirmed=true&oauth_token=test_oauth_token&oauth_token_secret=test_oauth_token_secret", 614new StringContent("{\"errors\":[{\"code\":32,\"message\":\"Could not authenticate you.\"}]}", 629new StringContent("example response text",
WsFederation\WsFederationTest.cs (1)
453var newResponse = new HttpResponseMessage() { Content = new StringContent(metadata, Encoding.UTF8, "text/xml") };
WsFederation\WsFederationTest_Handler.cs (1)
449var newResponse = new HttpResponseMessage() { Content = new StringContent(metadata, Encoding.UTF8, "text/xml") };
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (6)
Logging\AcceptanceTests.cs (6)
172using var content = new StringContent(Content); 232using var content = new StringContent(Content, null, requestContentType); 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 (32)
RequestDelegateFactoryTests.cs (2)
2055multipartFormData.Add(new StringContent("hello"), "message"); 2056multipartFormData.Add(new StringContent("foo"), "name");
RequestDelegateGenerator\RequestDelegateCreationTests.Filters.cs (1)
225var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (17)
25var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 60var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 95var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 133var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 169var fileContent1 = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 170var fileContent2 = new StringContent("there", Encoding.UTF8, "application/octet-stream"); 212var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 249var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 285var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 358var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 392var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 441var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 481var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 520multipartFormData.Add(new StringContent("hello"), "message"); 521multipartFormData.Add(new StringContent("foo"), "name"); 818var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 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 (77)
ApiBehaviorTest.cs (3)
105Content = new StringContent("some content", Encoding.UTF8, "text/css"), 121Content = new StringContent("some content", Encoding.Latin1, "application/json"), 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));
ConsumesAttributeTestsBase.cs (5)
102request.Content = new StringContent(input, Encoding.UTF8, requestContentType); 123request.Content = new StringContent(input, Encoding.UTF8, requestContentType); 147request.Content = new StringContent(input, Encoding.UTF8, "application/xml"); 168request.Content = new StringContent(input, Encoding.UTF8, "application/vnd.example+json"); 191request.Content = new StringContent(input, Encoding.UTF8, "application/vnd.example+xml");
ContentNegotiationTest.cs (1)
403var content = new StringContent("1234", Encoding.UTF8, "application/custom");
ControllerFromServicesTests.cs (2)
81new StringContent(string.Empty)); 97new StringContent(string.Empty));
DoNotRespectBrowserAcceptHeaderTests.cs (2)
100request.Content = new StringContent(requestData, Encoding.UTF8, "application/xml"); 131request.Content = new StringContent(requestData, Encoding.UTF8, "application/xml");
FiltersTest.cs (1)
89Content = new StringContent("Test", Encoding.UTF8, "application/json"),
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");
HtmlGenerationTest.cs (1)
618requestMessage.Content = new StringContent(content, Encoding.UTF8, "application/json");
InputFormatterTests.cs (3)
45var content = new StringContent(input, Encoding.UTF8, "application/xml"); 61var content = new StringContent("Test Content", Encoding.GetEncoding(encoding), "text/plain"); 78var content = new StringContent("Test Content", Encoding.UTF8, contentType);
InputObjectValidationTests.cs (12)
75var content = new StringContent(input, Encoding.UTF8, "application/xml"); 97var content = new StringContent(input, Encoding.UTF8, "application/json"); 118var content = new StringContent("{\"Alias\":\"xyz\"}", Encoding.UTF8, "application/json"); 134var content = new StringContent(requestData, Encoding.UTF8, "application/json"); 164var content = new StringContent(requestContent, Encoding.UTF8, "application/json"); 204var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json"); 225var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json"); 245var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json"); 270Content = new StringContent(@"{ ""Id"": ""S-1-5-21-1004336348-1177238915-682003330-512"" }", Encoding.UTF8, "application/json"), 291Content = new StringContent(input, Encoding.UTF8, "application/json"), 320Content = new StringContent(input, Encoding.UTF8, "application/json"), 352Content = new StringContent(input, Encoding.UTF8, "application/xml"),
InputParentValidationTests.cs (1)
88return new StringContent(JsonConvert.SerializeObject(model), Encoding.UTF8, "application/json");
JsonInputFormatterTestBase.cs (6)
47var content = new StringContent(input, Encoding.UTF8, requestContentType); 66var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType); 84var content = new StringContent(input, Encoding.UTF8, "application/json"); 100var content = new StringContent(expected, Encoding.UTF8, "application/json"); 203var content = new StringContent(jsonInput, Encoding.UTF8, "application/json"); 222var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType);
JsonOutputFormatterTestBase.cs (1)
53request.Content = new StringContent(input, Encoding.UTF8, "application/xml");
JsonPatchInputFormatterTest.cs (1)
167Content = new StringContent(body, Encoding.UTF8, "application/json-patch+json"),
NewtonsoftJsonInputFormatterTest.cs (3)
16var content = new StringContent("{", Encoding.UTF8, "application/json"); 35var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType); 52var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType);
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));
RequestSizeLimitTest.cs (1)
83request.Content = new StringContent(expected, Encoding.UTF8, "text/json");
RoutingFallbackTest.cs (1)
138Content = new StringContent("some plaintext", Encoding.UTF8, "text/plain"),
SerializableErrorTests.cs (3)
74Content = new StringContent(expectedXml, Encoding.UTF8, acceptHeader) 122request.Content = new StringContent(inputXml, Encoding.UTF8, acceptHeader); 163request.Content = new StringContent(inputXml, Encoding.UTF8, acceptHeader);
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");
XmlDataContractSerializerInputFormatterTest.cs (3)
40var content = new StringContent(input, Encoding.UTF8, "application/xml-dcs"); 59request.Content = new StringContent(input, Encoding.UTF8, "application/xml-dcs"); 87request.Content = new StringContent(input, Encoding.UTF8, "application/xml-dcs");
XmlSerializerInputFormatterTests.cs (2)
41var content = new StringContent(input, Encoding.UTF8, "application/xml-xmlser"); 58var content = new StringContent(input, Encoding.UTF8, "application/xml-xmlser");
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.Build.Tasks.Feed (1)
src\CreateAzureDevOpsFeed.cs (1)
149createFeedMessage.Content = new StringContent(createBody, Encoding.UTF8, "application/json");
Microsoft.DotNet.Deployment.Tasks.Links (1)
Microsoft.DotNet.Helix.Sdk (3)
CreateFailedTestsForFailedWorkItems.cs (1)
43Content = new StringContent(
StartAzurePipelinesTestRun.cs (1)
38Content = new StringContent(
StopAzurePipelinesTestRun.cs (1)
33Content = new StringContent(
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.Internal.SymbolHelper (2)
SymbolPromotionHelper.cs (2)
152Content = new StringContent(payload.ToString(), Encoding.UTF8, "application/json") 269Content = new StringContent(extensionPayload.ToString(), Encoding.UTF8, "application/json")
Microsoft.DotNet.VersionTools (11)
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);
Automation\VstsApi\VstsAdapterClient.cs (3)
134var bodyContent = new StringContent(createPrBody, Encoding.UTF8, "application/json"); 171Content = new StringContent( 270var bodyContent = new StringContent(body, Encoding.UTF8, "application/json");
Microsoft.Extensions.Http.Diagnostics.Tests (44)
Logging\HttpClientLoggerTest.cs (17)
87Content = new StringContent(input, Encoding.UTF8, TextPlain) 125Content = new StringContent(input, Encoding.UTF8, TextPlain) 187Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 196Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 283Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 290Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 388Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 396Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 484Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 492Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 599Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 606Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 691Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 734Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 772Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 816Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 961Content = new StringContent("request_content", Encoding.UTF8, TextPlain)
Logging\HttpHeadersReaderTest.cs (2)
131using var requestContent = new StringContent(string.Empty); 140using var responseContent = new StringContent(string.Empty);
Logging\HttpRequestBodyReaderTest.cs (6)
41Content = new StringContent(input, Encoding.UTF8, "text/plain"), 85Content = new StringContent(input, Encoding.UTF8, contentType), 106Content = new StringContent(input, Encoding.UTF8, "text/plain"), 134Content = new StringContent(input, Encoding.UTF8, "text/plain"), 158Content = new StringContent(input, Encoding.UTF8, "text/plain"), 232Content = new StringContent("content", Encoding.UTF8, "text/plain"),
Logging\HttpRequestReaderTest.cs (15)
84Content = new StringContent(requestContent, Encoding.UTF8) 93Content = new StringContent(responseContent, Encoding.UTF8) 147Content = new StringContent(requestContent, Encoding.UTF8) 153Content = new StringContent(responseContent, Encoding.UTF8) 210Content = new StringContent(requestContent, Encoding.UTF8), 222Content = new StringContent(responseContent, Encoding.UTF8) 285Content = new StringContent(requestContent, Encoding.UTF8), 297Content = new StringContent(responseContent, Encoding.UTF8) 357Content = new StringContent(requestContent, Encoding.UTF8), 415Content = new StringContent(requestContent, Encoding.UTF8), 427Content = new StringContent(responseContent, Encoding.UTF8) 486Content = new StringContent(requestContent, Encoding.UTF8), 494Content = new StringContent(responseContent, Encoding.UTF8) 553Content = new StringContent(requestContent, Encoding.UTF8), 562Content = new StringContent(responseContent, Encoding.UTF8)
Logging\HttpResponseBodyReaderTest.cs (4)
42Content = new StringContent(expectedContentBody, Encoding.UTF8, "text/plain") 85Content = new StringContent(expectedContentBody, Encoding.UTF8, contentType) 105Content = new StringContent(input, Encoding.UTF8, "text/plain") 129Content = new StringContent(bigContent, Encoding.UTF8, "text/plain")
Microsoft.Extensions.Http.Resilience.Tests (1)
Resilience\RequestMessageSnapshotTests.cs (1)
60Content = new StringContent("{\"name\":\"John Doe\",\"age\":33}", Encoding.UTF8, "application/json")
89 references to StringContent
IIS.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (5)
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);
IISExpress.FunctionalTests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (5)
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);
Interop.FunctionalTests (1)
Http3\Http3RequestTests.cs (1)
722var requestContent = new StringContent("Hello world");
Microsoft.AspNetCore.Authentication.Test (1)
OpenIdConnect\TestSettings.cs (1)
339var content = new StringContent(body, Encoding.UTF8, "application/json");
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (5)
Logging\AcceptanceTests.cs (5)
172using var content = new StringContent(Content); 232using var content = new StringContent(Content, null, requestContentType); 606using var content = new StringContent(Content); 640using var content = new StringContent(Content); 669using var content = new StringContent("Client: hello!");
Microsoft.AspNetCore.Http.Extensions.Tests (15)
RequestDelegateGenerator\RequestDelegateCreationTests.Filters.cs (1)
225var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (14)
25var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 60var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 95var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 133var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 169var fileContent1 = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 170var fileContent2 = new StringContent("there", Encoding.UTF8, "application/octet-stream"); 212var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 249var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 285var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 358var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 392var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 441var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 481var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream"); 818var fileContent = new StringContent("hello", Encoding.UTF8, "application/octet-stream");
Microsoft.AspNetCore.Mvc.FunctionalTests (27)
ContentNegotiationTest.cs (1)
403var content = new StringContent("1234", Encoding.UTF8, "application/custom");
InputFormatterTests.cs (3)
45var content = new StringContent(input, Encoding.UTF8, "application/xml"); 61var content = new StringContent("Test Content", Encoding.GetEncoding(encoding), "text/plain"); 78var content = new StringContent("Test Content", Encoding.UTF8, contentType);
InputObjectValidationTests.cs (8)
75var content = new StringContent(input, Encoding.UTF8, "application/xml"); 97var content = new StringContent(input, Encoding.UTF8, "application/json"); 118var content = new StringContent("{\"Alias\":\"xyz\"}", Encoding.UTF8, "application/json"); 134var content = new StringContent(requestData, Encoding.UTF8, "application/json"); 164var content = new StringContent(requestContent, Encoding.UTF8, "application/json"); 204var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json"); 225var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json"); 245var content = new StringContent(invalidRequestData, Encoding.UTF8, "application/json");
InputParentValidationTests.cs (3)
47var content = CreateInvalidModel(false); 66var content = CreateInvalidModel(true); 81private StringContent CreateInvalidModel(bool isChildValid)
JsonInputFormatterTestBase.cs (6)
47var content = new StringContent(input, Encoding.UTF8, requestContentType); 66var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType); 84var content = new StringContent(input, Encoding.UTF8, "application/json"); 100var content = new StringContent(expected, Encoding.UTF8, "application/json"); 203var content = new StringContent(jsonInput, Encoding.UTF8, "application/json"); 222var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType);
NewtonsoftJsonInputFormatterTest.cs (3)
16var content = new StringContent("{", Encoding.UTF8, "application/json"); 35var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType); 52var content = new StringContent(jsonInput, Encoding.UTF8, requestContentType);
XmlDataContractSerializerInputFormatterTest.cs (1)
40var content = new StringContent(input, Encoding.UTF8, "application/xml-dcs");
XmlSerializerInputFormatterTests.cs (2)
41var content = new StringContent(input, Encoding.UTF8, "application/xml-xmlser"); 58var content = new StringContent(input, Encoding.UTF8, "application/xml-xmlser");
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
DelegateTests.cs (1)
277var content = new StringContent("Sample request body");
Microsoft.AspNetCore.TestHost.Tests (2)
TestClientTests.cs (2)
98var content = new StringContent("Hello world"); 116var content = new StringContent("Hello world");
Microsoft.DotNet.VersionTools (9)
Automation\GitHubApi\GitHubClient.cs (7)
140var bodyContent = new StringContent(updateFileBody); 168var bodyContent = new StringContent(createPrBody); 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);
Automation\VstsApi\VstsAdapterClient.cs (2)
134var bodyContent = new StringContent(createPrBody, Encoding.UTF8, "application/json"); 270var bodyContent = new StringContent(body, Encoding.UTF8, "application/json");
Microsoft.Extensions.Http.Diagnostics.Tests (2)
Logging\HttpHeadersReaderTest.cs (2)
131using var requestContent = new StringContent(string.Empty); 140using var responseContent = new StringContent(string.Empty);
netstandard (1)
netstandard.cs (1)
1138[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Http.StringContent))]
System.Net.Http (15)
System\Net\Http\StringContent.cs (15)
19/// <summary>Creates a new instance of the <see cref="StringContent"/> class.</summary> 20/// <param name="content">The content used to initialize the <see cref="StringContent"/>.</param> 21/// <remarks>The media type for the <see cref="StringContent"/> created defaults to text/plain.</remarks> 27/// <summary>Creates a new instance of the <see cref="StringContent"/> class.</summary> 28/// <param name="content">The content used to initialize the <see cref="StringContent"/>.</param> 35/// <summary>Creates a new instance of the <see cref="StringContent"/> class.</summary> 36/// <param name="content">The content used to initialize the <see cref="StringContent"/>.</param> 38/// <remarks>The media type for the <see cref="StringContent"/> created defaults to text/plain.</remarks> 44/// <summary>Creates a new instance of the <see cref="StringContent"/> class.</summary> 45/// <param name="content">The content used to initialize the <see cref="StringContent"/>.</param> 76/// <summary>Creates a new instance of the <see cref="StringContent"/> class.</summary> 77/// <param name="content">The content used to initialize the <see cref="StringContent"/>.</param> 87/// <param name="content">The content used to initialize the <see cref="StringContent"/>.</param> 108GetType() == typeof(StringContent) ? SerializeToStreamAsyncCore(stream, cancellationToken) : 112GetType() == typeof(StringContent) ? CreateMemoryStreamForByteArray() : // type check ensures we use possible derived type's CreateContentReadStreamAsync override