90 references to StringContent
Microsoft.AspNetCore.Authentication.Test (16)
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\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 (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.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.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");
System.Net.Http (2)
System\Net\Http\StringContent.cs (2)
23: this(content, DefaultStringEncoding, DefaultMediaType) 40: this(content, encoding, DefaultMediaType)