144 references to StringContent
aspire (1)
Utils\EnvironmentChecker\DcpConnectionChecker.cs (1)
336Content = new StringContent("""{"status":"Stopping","shutdownResourceCleanup":"None"}""", Encoding.UTF8, "application/merge-patch+json")
Aspire.Cli.Tests (80)
Agents\SigstoreNpmProvenanceCheckerTests.cs (1)
1192Content = new StringContent(attestationJson, Encoding.UTF8, "application/json")
Commands\AgentMcpCommandTests.cs (2)
53Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 60Content = 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 (6)
332Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 349Content = new StringContent(body!, System.Text.Encoding.UTF8, contentType!) 389Content = new StringContent("""{"apiKey":"test-api-key-123"}""", System.Text.Encoding.UTF8, "application/json") 406Content = new StringContent("""{"apiKey":null}""", System.Text.Encoding.UTF8, "application/json") 482Content = new StringContent("""{"apiKey":"key"}""", System.Text.Encoding.UTF8, "application/json") 499Content = new StringContent("""{"apiKey":"key"}""", System.Text.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") 339Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 377Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 420Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 493Content = new StringContent("<html></html>", System.Text.Encoding.UTF8, "text/html") 530Content = new StringContent("""{"apiKey":"test-key"}""", System.Text.Encoding.UTF8, "application/json") 537Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 545Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") 621Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 628Content = new StringContent(responseJson, System.Text.Encoding.UTF8, "application/json") 685Content = new StringContent("[]", System.Text.Encoding.UTF8, "application/json") 694Content = 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)
564Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 570Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json")
Mcp\ListStructuredLogsToolTests.cs (8)
160Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 167Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 254Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 261Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 309Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 316Content = new StringContent(emptyLogsJson, System.Text.Encoding.UTF8, "application/json") 448Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 455Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json")
Mcp\ListTracesToolTests.cs (10)
132Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 139Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 239Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 246Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 294Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 301Content = new StringContent(emptyTracesJson, System.Text.Encoding.UTF8, "application/json") 398Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 404Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json") 490Content = new StringContent(resourcesResponse, System.Text.Encoding.UTF8, "application/json") 497Content = new StringContent(apiResponse, System.Text.Encoding.UTF8, "application/json")
ProfileCaptureServiceTests.cs (3)
419Content = new StringContent("<html></html>", Encoding.UTF8, "text/html") 435Content = new StringContent("{", Encoding.UTF8, "application/json") 605Content = new StringContent(
Telemetry\InternalMicrosoftDetectorTests.cs (1)
592Content = 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)
3849? new StringContent(requestData.Content, Encoding.UTF8, requestData.ContentType)
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
819Content = new StringContent(responseBody, Encoding.UTF8, mediaType)
Aspire.Hosting.GitHub.Models (1)
GitHubModelsHealthCheck.cs (1)
53request.Content = new StringContent(jsonPayload, System.Text.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");
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), 284Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 291Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 391Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 399Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 488Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 496Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 604Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 611Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 697Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 740Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 778Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 822Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 969Content = 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)