184 writes to Content
Aspire.Cli.Tests (105)
Agents\AspireSkillsInstallerTests.cs (9)
214Content = new ByteArrayContent(archiveBytes) 264Content = new ByteArrayContent(archiveBytes) 331Content = new ByteArrayContent(archiveBytes) 999Content = new ByteArrayContent(archiveBytes) 1579Content = new ByteArrayContent(archiveBytes) 1644Content = new ByteArrayContent(archiveBytes) 1693Content = new ByteArrayContent(malformedArchiveBytes) 1749Content = new ByteArrayContent(archiveBytes) 2180Content = new StringContent(json)
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\ApiDocs\ApiDocsCacheTests.cs (2)
29Content = new StringContent("<urlset></urlset>") 55Content = new StringContent("# Methods")
Mcp\ApiDocs\ApiDocsFetcherTests.cs (3)
30Content = new StringContent(expectedContent) 56Content = new StringContent(expectedContent) 83Content = new StringContent(expectedContent)
Mcp\Docs\DocsCacheTests.cs (1)
28Content = new StringContent("# Content")
Mcp\Docs\DocsFetcherTests.cs (10)
36Content = new StringContent(expectedContent) 55Content = new StringContent("# Content") 77Content = new StringContent(content) 159Content = new StringContent(freshContent) 226Content = new StringContent("") 246Content = new StringContent(whitespace) 265Content = null 329Content = new StringContent(serverContent) 362Content = new StringContent(serverContent) 405Content = new StringContent("# Content")
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 (4)
Telemetry\DashboardTelemetrySenderTests.cs (1)
87return Task.FromResult(new HttpResponseMessage(telemetryEnabledResponseStatusCode.Value) { Content = new StringContent(telemetryEnabledResponseBody ?? string.Empty) });
Telemetry\DashboardTelemetryServiceTests.cs (3)
110Content = new StringContent(JsonSerializer.Serialize(new TelemetryEnabledResponse(IsEnabled: true)) ?? string.Empty) 125Content = new StringContent(JsonSerializer.Serialize(new TelemetryEventCorrelation { Id = userTaskCorrelationId })) 135Content = new StringContent(JsonSerializer.Serialize(new TelemetryEventCorrelation { Id = Guid.NewGuid() }))
Aspire.Hosting.Azure.Tests (9)
AcrLoginServiceTests.cs (4)
27Content = new StringContent("""{"refresh_token":"refresh-token"}""") 53Content = new StringContent("bad request") 75Content = new StringContent("registry not ready") 97Content = new StringContent("registry not ready")
AzureSandboxesTests.cs (5)
1077Content = JsonContent.Create(new { message = "cleanup failed" }) 1456Content = new StreamContent(new FailingReadStream()) 1570Content = new StringContent(secret, Encoding.UTF8, "text/plain") 1589Content = JsonContent.Create(new 3128Content = new StringContent(content, Encoding.UTF8, "application/json")
Aspire.Hosting.Foundry.Tests (1)
HostedAgentExtensionTests.cs (1)
819Content = new StringContent(responseBody, Encoding.UTF8, mediaType)
Aspire.Hosting.Tests (4)
WithHttpCommandTests.cs (4)
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") 579response.Content = mediaType is not null
dotnet-svcutil-lib (3)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageExtensionMethods.cs (1)
35httpResponseMessage.Content = new ByteArrayContent(Array.Empty<byte>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageProperty.cs (2)
373this.HttpResponseMessage.Content = newContent; 378this.HttpResponseMessage.Content = new ByteArrayContent(Array.Empty<byte>());
Microsoft.Arcade.Common (2)
ArcadeHttpMessageHandler.cs (2)
27Content = requestResponse.ResponseMessage.Content 34Content = new StringContent($"No response specified in RequestResponses for '({request.Method}) {request.RequestUri}")
Microsoft.AspNetCore.TestHost (1)
ClientHandler.cs (1)
217response.Content = new StreamContent(httpContext.Response.Body);
Microsoft.Extensions.AI.Integration.Tests (2)
VerbatimHttpHandler.cs (1)
86return new() { Content = new StringContent(_expectedOutput) };
VerbatimMultiPartHttpHandler.cs (1)
153return new() { Content = new StringContent(sentJsonOutput, Encoding.UTF8, "application/json") };
Microsoft.Extensions.AI.OpenAI.Tests (15)
OpenAIHostedFileClientTests.cs (14)
573? new HttpResponseMessage(HttpStatusCode.OK) { Content = new ByteArrayContent(fileData) } 576Content = new StringContent(""" 607? new HttpResponseMessage(HttpStatusCode.OK) { Content = new ByteArrayContent(fileData) } 610Content = new StringContent(""" 650Content = new StringContent(""" 675Content = new StringContent(""" 702? new HttpResponseMessage(HttpStatusCode.OK) { Content = new ByteArrayContent(fileData) } 705Content = new StringContent(""" 732Content = new StringContent(""" 769Content = new StringContent(""" 804Content = new StringContent("{}", Encoding.UTF8, "application/json") 834Content = new StringContent(""" 859Content = new StringContent(""" 903Task.FromResult(new HttpResponseMessage(HttpStatusCode.NotFound) { Content = new StringContent("{}") });
OpenAIResponseClientTests.cs (1)
6884return new HttpResponseMessage { Content = new StringContent(body) };
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\HttpResponseBodyReader.cs (1)
126response.Content = newContent;
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (2)
NoRemoteCallHandler.cs (1)
41Content = new StreamContent(new MemoryStream(_data, writable: false))
NoRemoteCallNotSeekableHandler.cs (1)
44Content = new StreamContent(new NotSeekableStream(new MemoryStream(_data)))
Microsoft.Extensions.Http.Diagnostics.Tests (25)
Logging\HttpClientLoggerTest.cs (6)
196Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 291Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 399Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 496Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 611Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 882Content = responseContent,
Logging\HttpHeadersReaderTest.cs (1)
145using var httpResponse = new HttpResponseMessage { Content = responseContent };
Logging\HttpRequestReaderTest.cs (7)
96Content = new StringContent(responseContent, Encoding.UTF8) 158Content = new StringContent(responseContent, Encoding.UTF8) 229Content = new StringContent(responseContent, Encoding.UTF8) 305Content = new StringContent(responseContent, Encoding.UTF8) 438Content = new StringContent(responseContent, Encoding.UTF8) 507Content = new StringContent(responseContent, Encoding.UTF8) 577Content = new StringContent(responseContent, Encoding.UTF8)
Logging\HttpResponseBodyReaderTest.cs (10)
50Content = new StringContent(expectedContentBody, Encoding.UTF8, TextPlain) 68Content = new StreamContent(new MemoryStream()) 86Content = new StringContent(string.Empty, Encoding.UTF8, TextPlain) 111Content = new StringContent(expectedContentBody, Encoding.UTF8, contentType) 131Content = new StringContent(input, Encoding.UTF8, TextPlain) 155Content = new StreamContent(new NotSeekableStream(new(Encoding.UTF8.GetBytes(bigContent)))) 182Content = new StreamContent(new NotSeekableStream(new(Encoding.UTF8.GetBytes(bigContent)))) 222Content = new StreamContent(streamMock.Object) 251Content = new StreamContent(streamMock.Object) 294Content = new StreamContent(seekable ? memoryStream : new NotSeekableStream(memoryStream))
Logging\Internal\NoRemoteCallHandler.cs (1)
35Content = new StreamContent(new MemoryStream(_fileContent))
NuGet.Protocol (1)
HttpSource\HttpRetryHandler.cs (1)
193response.Content = newContent;
System.Net.Http (7)
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (4)
110response.Content = new GZipDecompressedContent(response.Content, encodings); 114response.Content = new DeflateDecompressedContent(response.Content, encodings); 118response.Content = new BrotliDecompressedContent(response.Content, encodings); 122response.Content = new ZstandardDecompressedContent(response.Content, encodings);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (1)
141Content = new HttpConnectionResponseContent()
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
1098Content = new HttpConnectionResponseContent(),
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
668var response = new HttpResponseMessage() { RequestMessage = request, Content = new HttpConnectionResponseContent() };
System.Net.Http.WinHttpHandler (1)
System\Net\Http\WinHttpResponseParser.cs (1)
63response.Content = new NoWriteNoSeekStreamContent(responseStream);
System.ServiceModel.Http (1)
System\ServiceModel\Channels\HttpResponseMessageExtensionMethods.cs (1)
29httpResponseMessage.Content = new ByteArrayContent(Array.Empty<byte>());
280 references to Content
aspire (25)
Agents\AspireSkills\AspireSkillsInstaller.cs (2)
446var json = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); 539await response.Content.CopyToAsync(fileStream, cancellationToken).ConfigureAwait(false);
Agents\AspireSkills\GitHubArtifactAttestationVerifier.cs (1)
56attestationJson = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Commands\ExportCommand.cs (2)
298var json = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); 329var json = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Commands\TelemetryCommandHelpers.cs (4)
130var mediaType = response.Content.Headers.ContentType?.MediaType; 154response.Content.Headers.ContentType?.MediaType is "text/html") 165var mediaType = response.Content.Headers.ContentType?.MediaType ?? "(none)"; 511var resources = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.ResourceInfoJsonArray, cancellationToken).ConfigureAwait(false) ?? [];
Commands\TelemetryLogsCommand.cs (2)
171var json = await response.Content.ReadAsStringAsync(cancellationToken); 193using var stream = await response.Content.ReadAsStreamAsync(cancellationToken);
Commands\TelemetrySpansCommand.cs (2)
163var json = await response.Content.ReadAsStringAsync(cancellationToken); 185using var stream = await response.Content.ReadAsStreamAsync(cancellationToken);
Commands\TelemetryTracesCommand.cs (2)
147var json = await response.Content.ReadAsStringAsync(cancellationToken); 209var json = await response.Content.ReadAsStringAsync(cancellationToken);
Documentation\CachedHttpDocumentFetcher.cs (2)
64var retryContent = await retryResponse.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); 78var content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Mcp\Tools\ListStructuredLogsTool.cs (1)
102var apiResponse = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse, cancellationToken).ConfigureAwait(false);
Mcp\Tools\ListTracesTool.cs (1)
102var apiResponse = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse, cancellationToken).ConfigureAwait(false);
Mcp\Tools\ListTraceStructuredLogsTool.cs (1)
92var apiResponse = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse, cancellationToken).ConfigureAwait(false);
Npm\SigstoreNpmProvenanceChecker.cs (1)
166return await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Profiling\ProfileCaptureService.cs (1)
456return await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse, cancellationToken).ConfigureAwait(false);
Telemetry\InternalMicrosoftDetector.cs (2)
719using var doc = JsonDocument.Parse(await membershipResponse.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false)); 751using var doc = JsonDocument.Parse(await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false));
Utils\CliDownloader.cs (1)
203await response.Content.CopyToAsync(fileStream, cts.Token);
Aspire.Cli.EndToEnd.Tests (3)
Helpers\CliE2ETestHelpers.cs (3)
642await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken); 837await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken); 878await using var stream = await response.Content.ReadAsStreamAsync(cancellationToken);
Aspire.Dashboard (2)
Telemetry\DashboardTelemetrySender.cs (1)
143var isTelemetryEnabled = response.IsSuccessStatusCode && await response.Content.ReadFromJsonAsync<TelemetryEnabledResponse>().ConfigureAwait(false) is { IsEnabled: true };
Telemetry\DashboardTelemetryService.cs (1)
359var response = await httpResponseMessage.Content.ReadFromJsonAsync<TResponse>().ConfigureAwait(false);
Aspire.Dashboard.Tests (40)
Integration\BlazorWebSocketOriginTests.cs (1)
28Assert.Equal("Origin not allowed.", await response.Content.ReadAsStringAsync());
Integration\FrontendBrowserTokenAuthTests.cs (1)
353var actualResult = await response.Content.ReadFromJsonAsync<bool>();
Integration\OtlpHttpJsonTests.cs (12)
514Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 516var responseBody = await responseMessage.Content.ReadAsStringAsync().DefaultTimeout(); 574Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 576var responseBody = await responseMessage.Content.ReadAsStringAsync().DefaultTimeout(); 651Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 653var responseBody = await responseMessage.Content.ReadAsStringAsync().DefaultTimeout(); 701Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 703var responseBody = await responseMessage.Content.ReadAsStringAsync().DefaultTimeout(); 753Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 755var responseBody = await responseMessage.Content.ReadAsStringAsync().DefaultTimeout(); 847Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 907Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType);
Integration\OtlpHttpServiceTests.cs (12)
56var response = ExportLogsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 59Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 185var response = ExportLogsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 188Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 281Assert.Equal("application/json", responseMessage.Content.Headers.ContentType?.MediaType); 284var responseBody = await responseMessage.Content.ReadAsStringAsync(); 350var response = ExportLogsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync()); 353Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 379var response = ExportTraceServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 382Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 408var response = ExportMetricsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 411Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single());
Integration\ResponseCompressionTests.cs (2)
31Assert.DoesNotContain(response.Content.Headers, h => h.Key == "Content-Encoding"); 53Assert.Contains(response.Content.Headers, h => h.Key == "Content-Encoding" && h.Value.Contains("br"));
Integration\StartupTests.cs (2)
530var response = ExportLogsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 532Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single());
Integration\TelemetryApiTests.cs (10)
92var content = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse); 118var content = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse); 164var content = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse); 186var content = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse); 208var content = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse); 248var content = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse); 361Assert.Equal("application/x-ndjson", response.Content.Headers.ContentType?.MediaType); 392Assert.Equal("application/x-ndjson", response.Content.Headers.ContentType?.MediaType); 422var content = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse); 444var content = await response.Content.ReadFromJsonAsync(OtlpJsonSerializerContext.Default.TelemetryApiResponse);
Aspire.EndToEnd.Tests (2)
IntegrationServicesTests.cs (1)
36var responseContent = await response.Content.ReadAsStringAsync(cancellationToken);
tests\Shared\TemplatesTesting\AspireProject.cs (1)
533if (args.Outcome.Result?.Content is HttpContent content && (await content.ReadAsStringAsync()) is string contentStr)
Aspire.Hosting (6)
Dcp\DcpKubernetesClient.cs (3)
82Body = await httpResponse.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false) 104var content = await httpResponse.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); 146var responseContent = await httpResponse.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
ResourceBuilderExtensions.cs (3)
3878if (TryGetHttpCommandResultFormat(commandOptions.ResultMode, response.Content?.Headers.ContentType, out var resultFormat) && 3879response.Content is not null) 3881var result = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure (1)
AcrLoginService.cs (1)
170var responseBody = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure.Sandboxes (3)
Internal\Adc\AzureDevComputeClient.cs (3)
216var result = await response.Content.ReadFromJsonAsync<T>(s_jsonSerializerOptions, cancellationToken).ConfigureAwait(false); 271var result = await response.Content.ReadFromJsonAsync<T>(s_jsonSerializerOptions, cancellationToken).ConfigureAwait(false); 471if (response.Content.Headers.ContentLength == 0)
Aspire.Hosting.Browsers (1)
BrowserEndpointDiscovery.cs (1)
225using var stream = await response.Content.ReadAsStreamAsync(probeCts.Token).ConfigureAwait(false);
Aspire.Hosting.Browsers.Tests (1)
src\Aspire.Hosting.Browsers\BrowserEndpointDiscovery.cs (1)
225using var stream = await response.Content.ReadAsStreamAsync(probeCts.Token).ConfigureAwait(false);
Aspire.Hosting.Foundry (3)
HostedAgent\HostedAgentBuilderExtension.cs (3)
360var errorPayload = await response.Content.ReadAsStringAsync(ctx.CancellationToken).ConfigureAwait(true); 369var responseJson = await response.Content.ReadFromJsonAsync<JsonElement>(cancellationToken: ctx.CancellationToken).ConfigureAwait(true); 383var responseText = await response.Content.ReadAsStringAsync(ctx.CancellationToken).ConfigureAwait(true);
Aspire.Hosting.GitHub.Models (1)
GitHubModelsHealthCheck.cs (1)
78var content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Aspire.Hosting.OpenAI (2)
OpenAIHealthCheck.cs (1)
90using var stream = await resp.Content.ReadAsStreamAsync(cts.Token).ConfigureAwait(false);
OpenAIModelHealthCheck.cs (1)
70var content = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Aspire.Hosting.PostgreSQL.Tests (1)
PostgresFunctionalTests.cs (1)
179var d = await response.Content.ReadAsStringAsync();
Aspire.Hosting.Redis.Tests (2)
RedisFunctionalTests.cs (2)
199var databases = await response.Content.ReadFromJsonAsync<List<RedisInsightDatabaseModel>>(cts.Token); 605var content = await response.Content.ReadAsStringAsync(ct);
Aspire.Hosting.Seq.Tests (1)
SeqFunctionalTests.cs (1)
62var reponseContent = await response.Content.ReadAsStringAsync(token);
Aspire.Hosting.Tests (2)
ContainerTunnelTests.cs (2)
40var body = await response.Content.ReadAsStringAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout); 79var body = await response.Content.ReadAsStringAsync().DefaultTimeout(TestConstants.DefaultOrchestratorTestTimeout);
Aspire.Playground.Tests (5)
BlazorWasmHostingTests.cs (4)
28var homeContent = await homeResponse.Content.ReadAsStringAsync(); 36var proxyApiContent = await proxyApiResponse.Content.ReadAsStringAsync(); 109var homeContent = await homeResponse.Content.ReadAsStringAsync(); 117var apiContent = await apiResponse.Content.ReadAsStringAsync();
ProjectSpecificTests.cs (1)
86var output = await response.Content.ReadAsStringAsync();
Aspire.Templates.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
533if (args.Outcome.Result?.Content is HttpContent content && (await content.ReadAsStringAsync()) is string contentStr)
DevTunnels.ApiService (2)
Program.cs (2)
16var contentLength = response.Content.Headers.ContentLength ?? (await response.Content.ReadAsStringAsync()).Length;
dotnet (1)
NugetSearch\NugetToolSearchApiRequest.cs (1)
47return await response.Content.ReadAsStringAsync(cancellation.Token);
dotnet-aot (2)
src\sdk\src\Cli\dotnet\NugetSearch\NugetToolSearchApiRequest.cs (2)
47return await response.Content.ReadAsStringAsync(cancellation.Token); 132var indexJson = await response.Content.ReadAsStringAsync(cancellation.Token);
dotnet-openapi (1)
HttpClientWrapper.cs (1)
51public Task<Stream> Stream => _response.Content.ReadAsStreamAsync();
dotnet-sourcelink (1)
dotnet-svcutil-lib (9)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageExtensionMethods.cs (4)
33if (httpResponseMessage.Content == null) 45HttpRequestMessageExtensionMethods.MergeWebHeaderCollectionWithHttpHeaders(headersToMerge, responseMessage.Headers, responseMessage.Content.Headers); 51if (httpResponse.Content != null) 53headers = headers.Concat(httpResponse.Content.Headers);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (3)
129var content = _httpResponseMessage.Content; 168var content = _httpResponseMessage.Content; 291var content = _httpResponseMessage.Content;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageProperty.cs (2)
345HttpContent content = this.HttpResponseMessage.Content; 362HttpContent content = this.HttpResponseMessage.Content;
Infrastructure.Common (3)
ServiceUtilHelper.cs (3)
579return response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); 598return response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult(); 617return await response.Content.ReadAsByteArrayAsync();
installer.tasks (1)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
80string tpnContent = await response.Content.ReadAsStringAsync();
Microsoft.Arcade.Common (1)
ArcadeHttpMessageHandler.cs (1)
27Content = requestResponse.ResponseMessage.Content
Microsoft.AspNetCore.Authentication.Facebook (1)
FacebookHandler.cs (1)
58using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted)))
Microsoft.AspNetCore.Authentication.Google (1)
GoogleHandler.cs (1)
56using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted)))
Microsoft.AspNetCore.Authentication.MicrosoftAccount (1)
MicrosoftAccountHandler.cs (1)
52using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted)))
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
223var body = await response.Content.ReadAsStringAsync(Context.RequestAborted);
Microsoft.AspNetCore.Authentication.OpenIdConnect (8)
OpenIdConnectHandler.cs (8)
616var contentType = parResponseMessage.Content.Headers.ContentType; 623var parResponseString = await parResponseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 1002var contentMediaType = responseMessage.Content.Headers.ContentType?.MediaType; 1011Logger.LogDebug($"Unexpected token response format. Status Code: {(int)responseMessage.StatusCode}. Content-Type {responseMessage.Content.Headers.ContentType}."); 1022var responseContent = await responseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 1027throw new OpenIdConnectProtocolException($"Failed to parse token response body as JSON. Status Code: {(int)responseMessage.StatusCode}. Content-Type: {responseMessage.Content.Headers.ContentType}", ex); 1068var userInfoResponse = await responseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 1071var contentType = responseMessage.Content.Headers.ContentType;
Microsoft.AspNetCore.Authentication.Twitter (5)
TwitterHandler.cs (5)
276var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 308var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 332var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 359var contentTypeIsJson = string.Equals(response.Content.Headers.ContentType?.MediaType ?? "", "application/json", StringComparison.OrdinalIgnoreCase); 371var errorContentStream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
Microsoft.AspNetCore.Http.Connections.Client (5)
HttpConnection.cs (2)
497var responseBuffer = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false); 793var responseBuffer = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
Internal\LongPollingTransport.cs (1)
192await response.Content.CopyToAsync(applicationStream, cancellationToken).ConfigureAwait(false);
Internal\LongPollingTransport.Log.cs (1)
49response.Content.Headers.ContentLength ?? -1);
Internal\ServerSentEventsTransport.cs (1)
134using (var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
Microsoft.AspNetCore.SpaServices.Extensions (2)
Proxying\SpaProxy.cs (2)
178foreach (var header in responseMessage.Content.Headers) 186using (var responseStream = await responseMessage.Content.ReadAsStreamAsync(cancellationToken))
Microsoft.AspNetCore.TestHost (1)
ClientHandler.cs (1)
223bool success = response.Content.Headers.TryAddWithoutValidation(header.Key, (IEnumerable<string>)header.Value);
Microsoft.Build.Tasks.Core (6)
DownloadFile.cs (6)
198Log.LogErrorFromResources("DownloadFile.Downloading", SourceUrl, destinationFile.FullName, response.Content.Headers.ContentLength); 208Log.LogMessageFromResources(MessageImportance.High, "DownloadFile.Downloading", SourceUrl, destinationFile.FullName, response.Content.Headers.ContentLength); 210using (Stream responseStream = await response.Content.ReadAsStreamAsync( 357&& destinationFile.Length == response.Content.Headers.ContentLength 358&& response.Content.Headers.LastModified.HasValue 359&& destinationFile.LastWriteTimeUtc > response.Content.Headers.LastModified.Value.UtcDateTime;
Microsoft.Deployment.DotNet.Releases (2)
Utils.cs (2)
35DateTime? onlineLastModified = httpResponse.Content.Headers.LastModified?.DateTime; 68await httpResponse.Content.CopyToAsync(stream).ConfigureAwait(false);
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
196await httpResponse.Content.CopyToAsync(outStream).ConfigureAwait(false);
Microsoft.DotNet.Cli.Telemetry (1)
Implementation\HttpTelemetryUploadTransport.cs (1)
60var body = await response.Content.ReadAsByteArrayAsync(cancellationToken).ConfigureAwait(false);
Microsoft.DotNet.HotReload.WebAssembly.Browser (1)
WebAssemblyHotReload.cs (1)
99var deltasJson = await response.Content.ReadAsStringAsync();
Microsoft.Extensions.AI.Evaluation.Safety (4)
ContentSafetyService.cs (4)
219await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); 271await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); 328await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); 398await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Microsoft.Extensions.AI.Integration.Tests (1)
VerbatimHttpHandler.cs (1)
80string? actualOutput = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
Microsoft.Extensions.DataIngestion.Tests (4)
Readers\DocumentReaderConformanceTests.cs (4)
83await response.Content.ReadAsStreamAsync(), 84source, mediaType: response.Content.Headers.ContentType?.MediaType!); 183string extension = response.Content.Headers.ContentType?.MediaType switch 194await response.Content.CopyToAsync(inputStream);
Microsoft.Extensions.Http (2)
Logging\LogHelper.cs (2)
96new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Response, response.Headers, response.Content?.Headers, shouldRedactHeaderValue), 135new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Response, response.Headers, response.Content?.Headers, shouldRedactHeaderValue),
Microsoft.Extensions.Http.Diagnostics (5)
Logging\Internal\HttpHeadersReader.cs (2)
65&& response.Content is not null 69ReadHeaders(response.Content.Headers, _responseHeadersToLog, destination);
Logging\Internal\HttpResponseBodyReader.cs (3)
49MediaTypeHeaderValue? contentType = response.Content.Headers.ContentType; 98Stream streamToReadFrom = await response.Content.ReadAsStreamAsync().WaitAsync(cancellationToken).ConfigureAwait(false); 121foreach (KeyValuePair<string, IEnumerable<string>> header in response.Content.Headers)
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (2)
NoRemoteCallHandler.cs (1)
44response.Content.Headers.ContentType = new("application/json");
NoRemoteCallNotSeekableHandler.cs (1)
47response.Content.Headers.ContentType = new("application/json");
Microsoft.Extensions.Http.Diagnostics.Tests (14)
Logging\AcceptanceTests.cs (4)
201var responseStream = await content.Content.ReadAsStreamAsync(); 253var responseStream = await content.Content.ReadAsStreamAsync(); 275responseStream = await content.Content.ReadAsStreamAsync(); 691var responseString = await content.Content.ReadAsStringAsync();
Logging\HttpResponseBodyReaderTest.cs (9)
157httpResponse.Content.Headers.Add("Content-Type", TextPlain); 164var response = await httpResponse.Content.ReadAsStringAsync(); 184httpResponse.Content.Headers.Add("Content-Type", TextPlain); 193var responseStream = await httpResponse.Content.ReadAsStreamAsync(); 225httpResponse.Content.Headers.Add("Content-type", TextPlain); 253httpResponse.Content.Headers.Add("Content-type", TextPlain); 296httpResponse.Content.Headers.Add("Content-Type", TextPlain); 306await httpResponse.Content.LoadIntoBufferAsync(); 310var response = await httpResponse.Content.ReadAsStringAsync();
Logging\Internal\NoRemoteCallHandler.cs (1)
38response.Content.Headers.ContentType = new("application/json");
Microsoft.Extensions.ML (1)
ModelLoaders\UriModelLoader.cs (1)
144using (var stream = await resp.Content.ReadAsStreamAsync())
Microsoft.Maui.Controls (1)
StreamWrapper.cs (1)
106 return new StreamWrapper(await response.Content.ReadAsStreamAsync().ConfigureAwait(false), response);
Microsoft.ML.AutoML.Tests (1)
DatasetUtil.cs (1)
211var stream = await response.EnsureSuccessStatusCode().Content.ReadAsStreamAsync().ConfigureAwait(false);
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
280var stream = await response.EnsureSuccessStatusCode().Content.ReadAsStreamAsync().ConfigureAwait(false);
Microsoft.ML.PerformanceTests (3)
ImageClassificationBench.cs (3)
164var totalSizeInBytes = headerResponse.Content.Headers.ContentLength; 173using Stream contentStream = response.Content.ReadAsStreamAsync().Result; 182using Stream contentStream = response.Content.ReadAsStreamAsync().Result;
Microsoft.ML.TestFrameworkCommon (2)
TestDownloadUtils.cs (2)
34long? expectedLength = response.Content.Headers.ContentLength; 35using (var contentStream = response.Content.ReadAsStreamAsync().GetAwaiter().GetResult())
Microsoft.ML.Tokenizers (1)
Utils\Helpers.netcoreapp.cs (1)
33return response.Content.ReadAsStream();
Microsoft.ML.Tokenizers.Data.Tests (1)
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (1)
24var stream = await response.Content.ReadAsStreamAsync();
Microsoft.ML.Tokenizers.Tests (2)
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (1)
33return response.Content.ReadAsStream();
Utils.cs (1)
24var stream = await response.Content.ReadAsStreamAsync();
Microsoft.NET.Build.Containers (14)
AuthHandshakeMessageHandler.cs (3)
495TokenResponse? tokenResponse = JsonSerializer.Deserialize<TokenResponse>(postResponse.Content.ReadAsStream(cancellationToken)); 539TokenResponse? token = JsonSerializer.Deserialize<TokenResponse>(tokenResponse.Content.ReadAsStream(cancellationToken)); 600_ = await response.Content.ReadAsByteArrayAsync(cancellationToken).ConfigureAwait(false);
Registry\DefaultBlobOperations.cs (2)
48JsonNode? configDoc = JsonNode.Parse(await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false)); 59return await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
Registry\HttpExtensions.cs (1)
76string detail = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Registry\Registry.cs (8)
196return initialManifestResponse.Content.Headers.ContentType?.MediaType switch 201initialManifestResponse.Content.Headers.ContentType.MediaType, 206await initialManifestResponse.Content.ReadFromJsonAsync<ManifestListV2>(cancellationToken: cancellationToken).ConfigureAwait(false), 214await initialManifestResponse.Content.ReadFromJsonAsync<ImageIndexV1>(cancellationToken: cancellationToken).ConfigureAwait(false), 229var manifest = (await initialManifestResponse.Content.ReadFromJsonAsync<ManifestV2>(cancellationToken: cancellationToken).ConfigureAwait(false))!; 244return initialManifestResponse.Content.Headers.ContentType?.MediaType switch 246SchemaTypes.DockerManifestListV2 => await initialManifestResponse.Content.ReadFromJsonAsync<ManifestListV2>(cancellationToken: cancellationToken).ConfigureAwait(false), 393var manifest = await manifestResponse.Content.ReadFromJsonAsync<ManifestV2>(cancellationToken: cancellationToken).ConfigureAwait(false);
Microsoft.NET.Sdk.Publish.Tasks (2)
Tasks\Http\HttpResponseMessageWrapper.cs (2)
48return _message is not null && _message.Content is not null 49? _message.Content.ReadAsStreamAsync()
Microsoft.TemplateSearch.Common (2)
Providers\NuGetMetadataSearchProvider.cs (2)
190string resultText = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); 241foreach (KeyValuePair<string, IEnumerable<string>> header in response.Content.Headers)
NuGet.Packaging (1)
Signing\Timestamp\Rfc3161TimestampRequestNetstandard21Wrapper.cs (1)
71var data = await httpResponse.Content.ReadAsByteArrayAsync();
NuGet.Protocol (9)
HttpSource\HttpCacheUtility.cs (1)
76using (var networkStream = await response.Content.ReadAsStreamAsync(cancellationToken))
HttpSource\HttpRetryHandler.cs (3)
166if (response.Content != null) 169var networkStream = await response.Content.ReadAsStreamAsync(cancellationToken); 188foreach (var header in response.Content.Headers)
HttpSource\HttpSource.cs (2)
184using (var stream = await throttledResponse.Response.Content.ReadAsStreamAsync(lockedToken)) 265var networkStream = await response.Content.ReadAsStreamAsync();
LegacyFeed\V2FeedParser.cs (1)
597var networkStream = await response.Content.ReadAsStreamAsync();
Resources\PackageSearchResourceV3.cs (2)
259using var stream = await httpInitialResponse.Content.ReadAsStreamAsync(token); 281using (var stream = await httpInitialResponse.Content.ReadAsStreamAsync(token))
Pipelines.Library (1)
DistributedApplicationPipelineExtensions.cs (1)
160var errorContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);
Stress.ApiService (1)
Program.cs (1)
172await response.Content.ReadAsStringAsync();
System.Net.Http (25)
System\Net\Http\HttpClient.cs (5)
199HttpContent c = response.Content; 273HttpContent c = response.Content; 347HttpContent c = response.Content; 501response.Content.LoadIntoBuffer(_maxResponseContentBufferSize, cts.Token); 556await response.Content.LoadIntoBufferAsync(_maxResponseContentBufferSize, cts.Token).ConfigureAwait(false);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
819return tunnelResponse.Content.ReadAsStream(cancellationToken);
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (6)
100Debug.Assert(response.Content != null); 101if (response.Content.Headers.TryGetValues(KnownHeaders.ContentEncoding.Descriptor, out IEnumerable<string>? contentEncodings)) 110response.Content = new GZipDecompressedContent(response.Content, encodings); 114response.Content = new DeflateDecompressedContent(response.Content, encodings); 118response.Content = new BrotliDecompressedContent(response.Content, encodings); 122response.Content = new ZstandardDecompressedContent(response.Content, encodings);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (4)
716Debug.Assert(_response != null && _response.Content != null); 718_response.Content.Headers.TryAddWithoutValidation(descriptor, headerValue); 1079Debug.Assert(_response != null && _response.Content != null); 1081var responseContent = (HttpConnectionResponseContent)_response.Content;
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (3)
253Debug.Assert(_response != null && _response.Content != null); 255var responseContent = (HttpConnectionResponseContent)_response.Content; 1146_response!.Content!.Headers.TryAddWithoutValidation(descriptor, headerValue);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (6)
818else if (response.Content.Headers.ContentLength != null) 820long contentLength = response.Content.Headers.ContentLength.GetValueOrDefault(); 835((HttpConnectionResponseContent)response.Content).SetStream(responseStream); 1309headers = response.Content!.Headers; 2109Debug.Assert(response.Content != null); 2110Stream stream = response.Content.ReadAsStream(cancellationToken);
System.Net.Http.Json (2)
System\Net\Http\Json\HttpClientJsonExtensions.cs (2)
123if (response.Content.Headers.ContentLength is long contentLength && contentLength > contentLengthLimit) 128ValueTask<Stream> task = HttpContentJsonExtensions.GetContentStreamAsync(response.Content, cancellationToken);
System.Net.Http.WinHttpHandler (2)
System\Net\Http\WinHttpResponseParser.cs (2)
71state.ExpectedBytesToRead = response.Content.Headers.ContentLength; 283HttpContentHeaders contentHeaders = response.Content.Headers;
System.Net.Requests (9)
System\Net\HttpWebResponse.cs (9)
86return _httpResponseMessage.Content?.Headers.ContentLength ?? -1; 99if (_httpResponseMessage.Content != null && _httpResponseMessage.Content.Headers.TryGetValues("Content-Type", out IEnumerable<string>? values)) 117if (_httpResponseMessage.Content != null) 119return GetHeaderValueAsString(_httpResponseMessage.Content.Headers.ContentEncoding); 208if (_httpResponseMessage.Content != null) 210foreach (var header in _httpResponseMessage.Content.Headers) 340if (_httpResponseMessage.Content != null) 342Stream contentStream = _httpResponseMessage.Content.ReadAsStream();
System.ServiceModel.Http (7)
System\ServiceModel\Channels\HttpResponseMessageExtensionMethods.cs (4)
27if (httpResponseMessage.Content == null) 39MergeWebHeaderCollectionWithHttpHeaders(headersToMerge, responseMessage.Headers, responseMessage.Content.Headers); 45if (httpResponse.Content != null) 47headers = headers.Concat(httpResponse.Content.Headers);
System\ServiceModel\Channels\HttpResponseMessageHelper.cs (3)
132var content = _httpResponseMessage.Content; 171var content = _httpResponseMessage.Content; 309var content = _httpResponseMessage.Content;
Yarp.Frontend (1)
Program.cs (1)
23return Results.Content(await response.Content.ReadAsStringAsync(), "application/json");