124 references to StringContent
Microsoft.AspNetCore.Authentication.Test (19)
FacebookTests.cs (1)
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 (3)
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 (1)
Logging\AcceptanceTests.cs (1)
232using var content = new StringContent(Content, null, requestContentType);
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 (49)
ApiBehaviorTest.cs (2)
105Content = new StringContent("some content", Encoding.UTF8, "text/css"), 121Content = new StringContent("some content", Encoding.Latin1, "application/json"),
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");
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"),
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);
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);
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.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.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 (3)
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 (27)
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\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\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")
System.Net.Http (2)
System\Net\Http\StringContent.cs (2)
23: this(content, DefaultStringEncoding, DefaultMediaType) 40: this(content, encoding, DefaultMediaType)