1 type derived from StringContent
Microsoft.Extensions.Http.Polly.Tests (1)
PolicyHttpMessageHandlerTest.cs (1)
449private class FakeContent : StringContent
235 instantiations of StringContent
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 (19)
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"));
IISExpress.FunctionalTests (21)
InProcess\WebSocketTests.cs (2)
37using var response = await client.PostAsync(_requestUri + "WebSocketNotUpgradable", new StringContent("Hello World")); 46using var response = await client.PostAsync(_requestUri + "WebSocketUpgradable", new StringContent(""));
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"));
Interop.FunctionalTests (2)
Http3\Http3RequestTests.cs (1)
720var 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 (19)
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\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)
335var 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.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)
129var 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"); 497message.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.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");
82 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)
720var requestContent = new StringContent("Hello world");
Microsoft.AspNetCore.Authentication.Test (1)
OpenIdConnect\TestSettings.cs (1)
335var content = new StringContent(body, Encoding.UTF8, "application/json");
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");
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