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