107 instantiations of StringContent
Aspire.Cli.Tests (30)
Commands\ExportCommandTests.cs (5)
248
Content = new
StringContent
(resourcesJson, System.Text.Encoding.UTF8, "application/json")
255
Content = new
StringContent
(BuildLogsJson(), System.Text.Encoding.UTF8, "application/json")
262
Content = new
StringContent
(BuildTracesJson(), System.Text.Encoding.UTF8, "application/json")
725
Content = new
StringContent
(resourcesJson, System.Text.Encoding.UTF8, "application/json")
735
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryTestHelper.cs (2)
96
Content = new
StringContent
(resourcesJson, System.Text.Encoding.UTF8, "application/json")
106
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
Mcp\Docs\DocsFetcherTests.cs (9)
26
Content = new
StringContent
(expectedContent)
45
Content = new
StringContent
("# Content")
67
Content = new
StringContent
(content)
149
Content = new
StringContent
(freshContent)
218
Content = new
StringContent
("")
238
Content = new
StringContent
(whitespace)
321
Content = new
StringContent
(serverContent)
354
Content = new
StringContent
(serverContent)
376
Content = new
StringContent
("# Content")
Mcp\ListStructuredLogsToolTests.cs (6)
160
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
167
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
263
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
270
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
318
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
325
Content = new
StringContent
(emptyLogsJson, System.Text.Encoding.UTF8, "application/json")
Mcp\ListTracesToolTests.cs (8)
132
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
139
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
245
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
252
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
300
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
307
Content = new
StringContent
(emptyTracesJson, System.Text.Encoding.UTF8, "application/json")
404
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
410
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
Aspire.Dashboard.Tests (12)
Integration\OtlpHttpJsonTests.cs (8)
411
var content = new
StringContent
(ExampleTraceJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
472
var content = new
StringContent
(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
549
var content = new
StringContent
(ExampleEventsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
599
var content = new
StringContent
(ExampleMetricsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
656
var content = new
StringContent
(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
684
var content = new
StringContent
(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
702
var content = new
StringContent
("{ invalid json }", Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
720
var content = new
StringContent
("{}", Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
Telemetry\DashboardTelemetrySenderTests.cs (1)
84
return Task.FromResult(new HttpResponseMessage(telemetryEnabledResponseStatusCode.Value) { Content = new
StringContent
(telemetryEnabledResponseBody ?? string.Empty) });
Telemetry\DashboardTelemetryServiceTests.cs (3)
110
Content = new
StringContent
(JsonSerializer.Serialize(new TelemetryEnabledResponse(IsEnabled: true)) ?? string.Empty)
125
Content = new
StringContent
(JsonSerializer.Serialize(new TelemetryEventCorrelation { Id = userTaskCorrelationId }))
135
Content = new
StringContent
(JsonSerializer.Serialize(new TelemetryEventCorrelation { Id = Guid.NewGuid() }))
Aspire.Hosting (1)
Dcp\DcpKubernetesClient.cs (1)
130
httpRequest.Content = new
StringContent
(content, System.Text.Encoding.UTF8);
Aspire.Hosting.Foundry (1)
HostedAgent\HostedAgentBuilderExtension.cs (1)
175
request.Content = new
StringContent
(new JsonObject() { ["input"] = input }.ToString(), System.Text.Encoding.UTF8, "application/json");
Aspire.Hosting.GitHub.Models (1)
GitHubModelsHealthCheck.cs (1)
53
request.Content = new
StringContent
(jsonPayload, System.Text.Encoding.UTF8, "application/json");
Aspire.Hosting.PostgreSQL.Tests (1)
PostgresFunctionalTests.cs (1)
171
{ new
StringContent
(dbName), "bookmark_id" }
Aspire.Hosting.Seq.Tests (1)
SeqFunctionalTests.cs (1)
53
var content = new
StringContent
(payload, Encoding.UTF8, "application/json");
Binding.Http.IntegrationTests (1)
BasicHttpBindingTests.4.0.0.cs (1)
165
message.Content = new
StringContent
(requestMessageBody);
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 (7)
Logging\AcceptanceTests.cs (7)
216
using var content = new
StringContent
(Content);
276
using var content = new
StringContent
(Content, null, requestContentType);
329
using var content = new
StringContent
(Content, null, MediaTypeNames.Text.Html);
380
Content = new
StringContent
(Content)
692
using var content = new
StringContent
(Content);
726
using var content = new
StringContent
(Content);
755
using var content = new
StringContent
("Client: hello!");
Microsoft.Extensions.AI.Evaluation.Safety (1)
ContentSafetyService.cs (1)
416
request.Content = new
StringContent
(payload ?? string.Empty);
Microsoft.Extensions.AI.Integration.Tests (2)
VerbatimHttpHandler.cs (1)
86
return new() { Content = new
StringContent
(_expectedOutput) };
VerbatimMultiPartHttpHandler.cs (1)
143
return new() { Content = new
StringContent
(sentJsonOutput, Encoding.UTF8, "application/json") };
Microsoft.Extensions.Http.Diagnostics.Tests (46)
Logging\HttpClientLoggerTest.cs (17)
87
Content = new
StringContent
(input, Encoding.UTF8, TextPlain)
125
Content = new
StringContent
(input, Encoding.UTF8, TextPlain)
187
Content = new
StringContent
(requestContent, Encoding.UTF8, TextPlain)
196
Content = new
StringContent
(responseContent, Encoding.UTF8, TextPlain),
284
Content = new
StringContent
(requestContent, Encoding.UTF8, TextPlain)
291
Content = new
StringContent
(responseContent, Encoding.UTF8, TextPlain),
391
Content = new
StringContent
(requestContent, Encoding.UTF8, TextPlain)
399
Content = new
StringContent
(responseContent, Encoding.UTF8, TextPlain),
488
Content = new
StringContent
(requestContent, Encoding.UTF8, TextPlain)
496
Content = new
StringContent
(responseContent, Encoding.UTF8, TextPlain),
604
Content = new
StringContent
(requestContent, Encoding.UTF8, TextPlain)
611
Content = new
StringContent
(responseContent, Encoding.UTF8, TextPlain),
697
Content = new
StringContent
(_fixture.Create<string>(), Encoding.UTF8, TextPlain)
740
Content = new
StringContent
(_fixture.Create<string>(), Encoding.UTF8, TextPlain)
778
Content = new
StringContent
(_fixture.Create<string>(), Encoding.UTF8, TextPlain)
822
Content = new
StringContent
(_fixture.Create<string>(), Encoding.UTF8, TextPlain)
969
Content = new
StringContent
("request_content", Encoding.UTF8, TextPlain)
Logging\HttpHeadersReaderTest.cs (2)
131
using var requestContent = new
StringContent
(string.Empty);
140
using var responseContent = new
StringContent
(string.Empty);
Logging\HttpRequestBodyReaderTest.cs (6)
41
Content = new
StringContent
(input, Encoding.UTF8, "text/plain"),
85
Content = new
StringContent
(input, Encoding.UTF8, contentType),
106
Content = new
StringContent
(input, Encoding.UTF8, "text/plain"),
134
Content = new
StringContent
(input, Encoding.UTF8, "text/plain"),
158
Content = new
StringContent
(input, Encoding.UTF8, "text/plain"),
232
Content = new
StringContent
("content", Encoding.UTF8, "text/plain"),
Logging\HttpRequestReaderTest.cs (17)
87
Content = new
StringContent
(requestContent, Encoding.UTF8)
96
Content = new
StringContent
(responseContent, Encoding.UTF8)
152
Content = new
StringContent
(requestContent, Encoding.UTF8)
158
Content = new
StringContent
(responseContent, Encoding.UTF8)
217
Content = new
StringContent
(requestContent, Encoding.UTF8),
229
Content = new
StringContent
(responseContent, Encoding.UTF8)
293
Content = new
StringContent
(requestContent, Encoding.UTF8),
305
Content = new
StringContent
(responseContent, Encoding.UTF8)
366
Content = new
StringContent
(requestContent, Encoding.UTF8),
426
Content = new
StringContent
(requestContent, Encoding.UTF8),
438
Content = new
StringContent
(responseContent, Encoding.UTF8)
499
Content = new
StringContent
(requestContent, Encoding.UTF8),
507
Content = new
StringContent
(responseContent, Encoding.UTF8)
568
Content = new
StringContent
(requestContent, Encoding.UTF8),
577
Content = new
StringContent
(responseContent, Encoding.UTF8)
630
Content = new
StringContent
(requestContent, Encoding.UTF8, "text/plain")
865
httpRequestMessage.Content = new
StringContent
(requestContent, Encoding.UTF8, "text/plain");
Logging\HttpResponseBodyReaderTest.cs (4)
50
Content = new
StringContent
(expectedContentBody, Encoding.UTF8, TextPlain)
86
Content = new
StringContent
(string.Empty, Encoding.UTF8, TextPlain)
111
Content = new
StringContent
(expectedContentBody, Encoding.UTF8, contentType)
131
Content = new
StringContent
(input, Encoding.UTF8, TextPlain)
Microsoft.Extensions.Http.Resilience.Tests (1)
Resilience\RequestMessageSnapshotTests.cs (1)
60
Content = new
StringContent
("{\"name\":\"John Doe\",\"age\":33}", Encoding.UTF8, "application/json")
Microsoft.NET.Build.Containers (1)
Registry\DefaultManifestOperations.cs (1)
43
HttpContent manifestUploadContent = new
StringContent
(manifestJson);
33 references to StringContent
Aspire.Dashboard.Tests (8)
Integration\OtlpHttpJsonTests.cs (8)
411
var
content = new StringContent(ExampleTraceJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
472
var
content = new StringContent(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
549
var
content = new StringContent(ExampleEventsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
599
var
content = new StringContent(ExampleMetricsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
656
var
content = new StringContent(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
684
var
content = new StringContent(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
702
var
content = new StringContent("{ invalid json }", Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
720
var
content = new StringContent("{}", Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
Aspire.Hosting.Seq.Tests (1)
SeqFunctionalTests.cs (1)
53
var
content = new StringContent(payload, Encoding.UTF8, "application/json");
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (6)
Logging\AcceptanceTests.cs (6)
216
using
var
content = new StringContent(Content);
276
using
var
content = new StringContent(Content, null, requestContentType);
329
using
var
content = new StringContent(Content, null, MediaTypeNames.Text.Html);
692
using
var
content = new StringContent(Content);
726
using
var
content = new StringContent(Content);
755
using
var
content = new StringContent("Client: hello!");
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);
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>
108
GetType() == typeof(
StringContent
) ? SerializeToStreamAsyncCore(stream, cancellationToken) :
112
GetType() == typeof(
StringContent
) ? CreateMemoryStreamForByteArray() : // type check ensures we use possible derived type's CreateContentReadStreamAsync override