166 references to StringContent
AnalyzeCiFailure (1)
tools\Aspire.TestTools\GitHubApiClient.cs (1)
305request.Content = new StringContent(body.ToJsonString(), Encoding.UTF8, "application/json");
AnalyzeCiFailure.TestHost (1)
tests\AnalyzeCiFailure.Tests\TestServices\GitHubFixtureHandler.cs (1)
254=> new(status) { Content = new StringContent(text, Encoding.UTF8, "application/json") };
AnalyzeCiFailure.Tests (1)
TestServices\GitHubFixtureHandler.cs (1)
254=> new(status) { Content = new StringContent(text, Encoding.UTF8, "application/json") };
aspire (1)
Utils\EnvironmentChecker\DcpConnectionChecker.cs (1)
336Content = new StringContent("""{"status":"Stopping","shutdownResourceCleanup":"None"}""", Encoding.UTF8, "application/merge-patch+json")
Aspire.Azure.AI.Extensions.OpenAI.Tests (1)
tests\Shared\FoundryClientTestHelpers.cs (1)
36Content = new StringContent(response, System.Text.Encoding.UTF8, "application/json")
Aspire.Azure.AI.Projects.Tests (1)
tests\Shared\FoundryClientTestHelpers.cs (1)
36Content = new StringContent(response, System.Text.Encoding.UTF8, "application/json")
Aspire.Cli.Tests (87)
Agents\SigstoreNpmProvenanceCheckerTests.cs (1)
1192Content = new StringContent(attestationJson, Encoding.UTF8, "application/json")
Commands\AgentMcpCommandTests.cs (2)
64Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 71Content = new StringContent("{\"data\":{},\"totalCount\":0,\"returnedCount\":0}", System.Text.Encoding.UTF8, "application/json")
Commands\ExportCommandTests.cs (5)
247Content = new StringContent(resourcesJson, System.Text.Encoding.UTF8, "application/json") 254Content = new StringContent(BuildLogsJson(), System.Text.Encoding.UTF8, "application/json") 261Content = new StringContent(BuildTracesJson(), System.Text.Encoding.UTF8, "application/json") 904Content = new StringContent(resourcesJson, System.Text.Encoding.UTF8, "application/json") 914Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryCommandTests.cs (7)
346Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 530Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 547Content = new StringContent(body!, System.Text.Encoding.UTF8, contentType!) 605Content = new StringContent("""{"apiKey":"test-api-key-123"}""", System.Text.Encoding.UTF8, "application/json") 622Content = new StringContent("""{"apiKey":null}""", System.Text.Encoding.UTF8, "application/json") 698Content = new StringContent("""{"apiKey":"key"}""", System.Text.Encoding.UTF8, "application/json") 715Content = new StringContent("""{"apiKey":"key"}""", System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryFollowTests.cs (1)
258Content = new StringContent("[]", Encoding.UTF8, "application/json")
Commands\TelemetryLogsCommandTests.cs (15)
195Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 203Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") 247Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 255Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") 344Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 382Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 425Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 498Content = new StringContent("<html></html>", System.Text.Encoding.UTF8, "text/html") 535Content = new StringContent("""{"apiKey":"test-key"}""", System.Text.Encoding.UTF8, "application/json") 542Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 550Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") 626Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 633Content = new StringContent(responseJson, System.Text.Encoding.UTF8, "application/json") 690Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 699Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetrySpansCommandTests.cs (10)
168Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 176Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") 239Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 281Content = new StringContent("<html></html>", System.Text.Encoding.UTF8, "text/html") 355Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 362Content = new StringContent(responseJson, System.Text.Encoding.UTF8, "application/json") 424Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 433Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") 471Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 480Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryTestHelper.cs (2)
98Content = new StringContent(resourcesJson, System.Text.Encoding.UTF8, "application/json") 108Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json")
Commands\TelemetryTracesCommandTests.cs (15)
108Content = new StringContent(resourcesJson, System.Text.Encoding.UTF8, "application/json") 112Content = new StringContent(tracesJson, System.Text.Encoding.UTF8, "application/json") 195Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 199Content = new StringContent(tracesJson, System.Text.Encoding.UTF8, "application/json") 413Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 421Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") 484Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 559Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 566Content = new StringContent(responseJson, System.Text.Encoding.UTF8, "application/json") 643Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 650Content = new StringContent(responseJson, System.Text.Encoding.UTF8, "application/json") 690Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 699Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") 737Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 746Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json")
Mcp\ExcludeFromMcpTests.cs (2)
598Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 604Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json")
Mcp\ListStructuredLogsToolTests.cs (10)
84Content = new StringContent( 131Content = new StringContent( 272Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 279Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 366Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 373Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 421Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 428Content = new StringContent(emptyLogsJson, System.Text.Encoding.UTF8, "application/json") 560Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 567Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json")
Mcp\ListTracesToolTests.cs (11)
37Content = new StringContent( 196Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 203Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 303Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 310Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 358Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 365Content = new StringContent(emptyTracesJson, System.Text.Encoding.UTF8, "application/json") 462Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 468Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 554Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 561Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json")
Mcp\ListTraceStructuredLogsToolTests.cs (1)
31Content = new StringContent(
Mcp\McpToolHelpersTests.cs (1)
240Content = new StringContent("""{"apiKey":"exchanged-api-key"}""", System.Text.Encoding.UTF8, "application/json")
ProfileCaptureServiceTests.cs (3)
483Content = new StringContent("<html></html>", Encoding.UTF8, "text/html") 499Content = new StringContent("{", Encoding.UTF8, "application/json") 668Content = new StringContent(
Telemetry\InternalMicrosoftDetectorTests.cs (1)
1748Content = new StringContent(json, Encoding.UTF8, "application/json")
Aspire.Dashboard.Tests (9)
Integration\OtlpHttpJsonTests.cs (9)
507var content = new StringContent(ExampleTraceJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType); 567var content = new StringContent(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType); 644var content = new StringContent(ExampleEventsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType); 694var content = new StringContent(ExampleMetricsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType); 746var content = new StringContent(MetricsJsonWithNumericBucketCounts, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType); 836var content = new StringContent(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType); 864var content = new StringContent(ExampleLogsJson, Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType); 882var content = new StringContent("{ invalid json }", Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType); 900var content = new StringContent("{}", Encoding.UTF8, OtlpHttpEndpointsBuilder.JsonContentType);
Aspire.Hosting (1)
ResourceBuilderExtensions.cs (1)
4240? new StringContent(requestData.Content, Encoding.UTF8, requestData.ContentType)
Aspire.Hosting.Azure.Tests (2)
AzureSandboxesTests.cs (2)
1705Content = new StringContent(secret, Encoding.UTF8, "text/plain") 3759Content = new StringContent(content, Encoding.UTF8, "application/json")
Aspire.Hosting.Foundry (1)
Toolbox\FoundryToolboxReadinessProbe.cs (1)
170request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
Aspire.Hosting.Foundry.Tests (6)
AzureFoundryToolboxAdministrationTests.cs (2)
58Content = new StringContent(responseJson, Encoding.UTF8, "application/json") 62Content = new StringContent(responseJson, Encoding.UTF8, "application/json")
HostedAgentExtensionTests.cs (1)
1043Content = new StringContent(responseBody, Encoding.UTF8, mediaType)
PromptAgentTests.cs (1)
130Content = new StringContent("""
ToolboxTests.cs (2)
400Content = new StringContent( 951Content = new StringContent(json, Encoding.UTF8, "application/json")
Aspire.Hosting.Native.Core.Tests (2)
DcpResponseTests.cs (1)
122Content = new StringContent(body, new UTF8Encoding(false), "application/json")
TestServices\DcpCleanupTestHandler.cs (1)
92Content = new StringContent(value, Encoding.UTF8, "application/json")
Aspire.Hosting.Seq.Tests (1)
SeqFunctionalTests.cs (1)
55var content = new StringContent(payload, Encoding.UTF8, "application/json");
Aspire.Hosting.Tests (5)
WithHttpCommandTests.cs (5)
52Content = new StringContent("""{"token":"abc123"}""", Encoding.UTF8, "application/json") 67Content = new StringContent("""{"token":"abc123"}""", Encoding.UTF8, "application/json") 86Content = new StringContent("invalid request", Encoding.UTF8, "text/plain") 580? new StringContent(responseBody, Encoding.UTF8, mediaType) 763requestContext.Request.Content = new StringContent(message, Encoding.UTF8, "text/plain");
Aspire.TestTools (1)
GitHubApiClient.cs (1)
305request.Content = new StringContent(body.ToJsonString(), Encoding.UTF8, "application/json");
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Logging\AcceptanceTests.cs (2)
276using var content = new StringContent(Content, null, requestContentType); 329using var content = new StringContent(Content, null, MediaTypeNames.Text.Html);
Microsoft.Extensions.AI.Integration.Tests (1)
VerbatimMultiPartHttpHandler.cs (1)
153return new() { Content = new StringContent(sentJsonOutput, Encoding.UTF8, "application/json") };
Microsoft.Extensions.AI.OpenAI.Tests (10)
OpenAIHostedFileClientTests.cs (10)
576Content = new StringContent(""" 610Content = new StringContent(""" 650Content = new StringContent(""" 675Content = new StringContent(""" 705Content = new StringContent(""" 732Content = new StringContent(""" 769Content = new StringContent(""" 804Content = new StringContent("{}", Encoding.UTF8, "application/json") 834Content = new StringContent(""" 859Content = new StringContent("""
Microsoft.Extensions.Http.Diagnostics.Tests (29)
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), 313Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 320Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 420Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 428Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 517Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 525Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 633Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 640Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 726Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 769Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 807Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 851Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 998Content = 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\HttpRequestReaderTest.cs (2)
665Content = new StringContent(requestContent, Encoding.UTF8, "text/plain") 900httpRequestMessage.Content = new StringContent(requestContent, Encoding.UTF8, "text/plain");
Logging\HttpResponseBodyReaderTest.cs (4)
50Content = new StringContent(expectedContentBody, Encoding.UTF8, TextPlain) 86Content = new StringContent(string.Empty, Encoding.UTF8, TextPlain) 111Content = new StringContent(expectedContentBody, Encoding.UTF8, contentType) 131Content = new StringContent(input, Encoding.UTF8, TextPlain)
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)