144 references to StringContent
aspire (1)
Utils\EnvironmentChecker\DcpConnectionChecker.cs (1)
336
Content = new
StringContent
("""{"status":"Stopping","shutdownResourceCleanup":"None"}""", Encoding.UTF8, "application/merge-patch+json")
Aspire.Cli.Tests (80)
Agents\SigstoreNpmProvenanceCheckerTests.cs (1)
1192
Content = new
StringContent
(attestationJson, Encoding.UTF8, "application/json")
Commands\AgentMcpCommandTests.cs (2)
53
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
60
Content = new
StringContent
("{\"data\":{},\"totalCount\":0,\"returnedCount\":0}", System.Text.Encoding.UTF8, "application/json")
Commands\ExportCommandTests.cs (5)
247
Content = new
StringContent
(resourcesJson, System.Text.Encoding.UTF8, "application/json")
254
Content = new
StringContent
(BuildLogsJson(), System.Text.Encoding.UTF8, "application/json")
261
Content = new
StringContent
(BuildTracesJson(), System.Text.Encoding.UTF8, "application/json")
904
Content = new
StringContent
(resourcesJson, System.Text.Encoding.UTF8, "application/json")
914
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryCommandTests.cs (6)
332
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
349
Content = new
StringContent
(body!, System.Text.Encoding.UTF8, contentType!)
389
Content = new
StringContent
("""{"apiKey":"test-api-key-123"}""", System.Text.Encoding.UTF8, "application/json")
406
Content = new
StringContent
("""{"apiKey":null}""", System.Text.Encoding.UTF8, "application/json")
482
Content = new
StringContent
("""{"apiKey":"key"}""", System.Text.Encoding.UTF8, "application/json")
499
Content = new
StringContent
("""{"apiKey":"key"}""", System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryLogsCommandTests.cs (15)
195
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
203
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
247
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
255
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
339
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
377
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
420
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
493
Content = new
StringContent
("<html></html>", System.Text.Encoding.UTF8, "text/html")
530
Content = new
StringContent
("""{"apiKey":"test-key"}""", System.Text.Encoding.UTF8, "application/json")
537
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
545
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
621
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
628
Content = new
StringContent
(responseJson, System.Text.Encoding.UTF8, "application/json")
685
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
694
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetrySpansCommandTests.cs (10)
168
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
176
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
239
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
281
Content = new
StringContent
("<html></html>", System.Text.Encoding.UTF8, "text/html")
355
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
362
Content = new
StringContent
(responseJson, System.Text.Encoding.UTF8, "application/json")
424
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
433
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
471
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
480
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryTestHelper.cs (2)
98
Content = new
StringContent
(resourcesJson, System.Text.Encoding.UTF8, "application/json")
108
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryTracesCommandTests.cs (15)
108
Content = new
StringContent
(resourcesJson, System.Text.Encoding.UTF8, "application/json")
112
Content = new
StringContent
(tracesJson, System.Text.Encoding.UTF8, "application/json")
195
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
199
Content = new
StringContent
(tracesJson, System.Text.Encoding.UTF8, "application/json")
413
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
421
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
484
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
559
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
566
Content = new
StringContent
(responseJson, System.Text.Encoding.UTF8, "application/json")
643
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
650
Content = new
StringContent
(responseJson, System.Text.Encoding.UTF8, "application/json")
690
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
699
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
737
Content = new
StringContent
("[]", System.Text.Encoding.UTF8, "application/json")
746
Content = new
StringContent
(json, System.Text.Encoding.UTF8, "application/json")
Mcp\ExcludeFromMcpTests.cs (2)
564
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
570
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
Mcp\ListStructuredLogsToolTests.cs (8)
160
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
167
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
254
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
261
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
309
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
316
Content = new
StringContent
(emptyLogsJson, System.Text.Encoding.UTF8, "application/json")
448
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
455
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
Mcp\ListTracesToolTests.cs (10)
132
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
139
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
239
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
246
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
294
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
301
Content = new
StringContent
(emptyTracesJson, System.Text.Encoding.UTF8, "application/json")
398
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
404
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
490
Content = new
StringContent
(resourcesResponse, System.Text.Encoding.UTF8, "application/json")
497
Content = new
StringContent
(apiResponse, System.Text.Encoding.UTF8, "application/json")
ProfileCaptureServiceTests.cs (3)
419
Content = new
StringContent
("<html></html>", Encoding.UTF8, "text/html")
435
Content = new
StringContent
("{", Encoding.UTF8, "application/json")
605
Content = new
StringContent
(
Telemetry\InternalMicrosoftDetectorTests.cs (1)
592
Content = new
StringContent
(json, Encoding.UTF8, "application/json")
Aspire.Dashboard.Tests (9)
Integration\OtlpHttpJsonTests.cs (9)
507
var content = new
StringContent
(ExampleTraceJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
567
var content = new
StringContent
(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
644
var content = new
StringContent
(ExampleEventsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
694
var content = new
StringContent
(ExampleMetricsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
746
var content = new
StringContent
(MetricsJsonWithNumericBucketCounts, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
836
var content = new
StringContent
(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
864
var content = new
StringContent
(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
882
var content = new
StringContent
("{ invalid json }", Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
900
var content = new
StringContent
("{}", Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
Aspire.Hosting (1)
ResourceBuilderExtensions.cs (1)
3849
? new
StringContent
(requestData.Content, Encoding.UTF8, requestData.ContentType)
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
819
Content = new
StringContent
(responseBody, Encoding.UTF8, mediaType)
Aspire.Hosting.GitHub.Models (1)
GitHubModelsHealthCheck.cs (1)
53
request.Content = new
StringContent
(jsonPayload, System.Text.Encoding.UTF8, "application/json");
Aspire.Hosting.Seq.Tests (1)
SeqFunctionalTests.cs (1)
55
var content = new
StringContent
(payload, Encoding.UTF8, "application/json");
Aspire.Hosting.Tests (5)
WithHttpCommandTests.cs (5)
52
Content = new
StringContent
("""{"token":"abc123"}""", Encoding.UTF8, "application/json")
67
Content = new
StringContent
("""{"token":"abc123"}""", Encoding.UTF8, "application/json")
86
Content = new
StringContent
("invalid request", Encoding.UTF8, "text/plain")
580
? new
StringContent
(responseBody, Encoding.UTF8, mediaType)
763
requestContext.Request.Content = new
StringContent
(message, Encoding.UTF8, "text/plain");
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Logging\AcceptanceTests.cs (2)
276
using var content = new
StringContent
(Content, null, requestContentType);
329
using var content = new
StringContent
(Content, null, MediaTypeNames.Text.Html);
Microsoft.Extensions.AI.Integration.Tests (1)
VerbatimMultiPartHttpHandler.cs (1)
153
return new() { Content = new
StringContent
(sentJsonOutput, Encoding.UTF8, "application/json") };
Microsoft.Extensions.AI.OpenAI.Tests (10)
OpenAIHostedFileClientTests.cs (10)
576
Content = new
StringContent
("""
610
Content = new
StringContent
("""
650
Content = new
StringContent
("""
675
Content = new
StringContent
("""
705
Content = new
StringContent
("""
732
Content = new
StringContent
("""
769
Content = new
StringContent
("""
804
Content = new
StringContent
("{}", Encoding.UTF8, "application/json")
834
Content = new
StringContent
("""
859
Content = new
StringContent
("""
Microsoft.Extensions.Http.Diagnostics.Tests (29)
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\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 (2)
665
Content = new
StringContent
(requestContent, Encoding.UTF8, "text/plain")
900
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")
System.Net.Http (2)
System\Net\Http\StringContent.cs (2)
23
:
this
(content, DefaultStringEncoding, DefaultMediaType)
40
:
this
(content, encoding, DefaultMediaType)