105 writes to Content
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.Authentication.Test (22)
FacebookTests.cs (3)
337res.Content = new StringContent(graphResponse, Encoding.UTF8); 346res.Content = new StringContent(graphResponse, Encoding.UTF8); 482res.Content = new StringContent(text, Encoding.UTF8, "application/json");
GoogleTests.cs (1)
1126res.Content = new StringContent(text, Encoding.UTF8, "application/json");
MicrosoftAccountTests.cs (1)
429res.Content = new StringContent(text, Encoding.UTF8, "application/json");
OAuthTests.cs (1)
537res.Content = new StringContent(text, Encoding.UTF8, "application/json");
OpenIdConnect\OpenIdConnectChallengeTests.cs (3)
978Content = 984return new HttpResponseMessage() { Content = new StringContent("{ }", Encoding.ASCII, "application/json") }; 994return new HttpResponseMessage() { Content = new StringContent("{ \"request_uri\": \"my_reference_value\", \"expires_in\": 60}", Encoding.ASCII, "application/json") };
OpenIdConnect\OpenIdConnectEventTests.cs (2)
1397Content = 1403return Task.FromResult(new HttpResponseMessage() { Content = new StringContent("{ }", Encoding.ASCII, "application/json") });
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (2)
1392Content = 1398return Task.FromResult(new HttpResponseMessage() { Content = new StringContent("{ }", Encoding.ASCII, "application/json") });
OpenIdConnect\TestSettings.cs (1)
342Content = content,
TwitterTests.cs (6)
407res.Content = new FormUrlEncodedContent(content); 476res.Content = new FormUrlEncodedContent(content); 486res.Content = new StringContent(graphResponse, Encoding.UTF8); 598Content = 613Content = 628Content =
WsFederation\WsFederationTest.cs (1)
453var newResponse = new HttpResponseMessage() { Content = new StringContent(metadata, Encoding.UTF8, "text/xml") };
WsFederation\WsFederationTest_Handler.cs (1)
449var newResponse = new HttpResponseMessage() { Content = new StringContent(metadata, Encoding.UTF8, "text/xml") };
Microsoft.AspNetCore.Http.Connections.Tests (1)
HttpConnectionDispatcherTests.cs (1)
3613response.Content = new ByteArrayContent(_stream.ToArray());
Microsoft.AspNetCore.SignalR.Client.Tests (11)
ResponseUtils.cs (1)
30Content = payload
ServerSentEventsTransportTests.cs (10)
44return new HttpResponseMessage { Content = new StreamContent(mockStream.Object) }; 91return Task.FromResult(new HttpResponseMessage { Content = new StreamContent(mockStream.Object) }); 144return new HttpResponseMessage { Content = new StreamContent(mockStream.Object) }; 197return new HttpResponseMessage { Content = new StreamContent(mockStream.Object) }; 250return new HttpResponseMessage { Content = new StreamContent(mockStream.Object) }; 277return new HttpResponseMessage { Content = new StringContent("data: 3:abc\r\n\r\n") }; 325return new HttpResponseMessage { Content = new StreamContent(mockStream.Object) }; 366return new HttpResponseMessage { Content = new StringContent(string.Empty) }; 393return new HttpResponseMessage { Content = new StringContent(string.Empty) }; 478return new HttpResponseMessage { Content = new StreamContent(new OneAtATimeStream(messageParts)) };
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaProxyTests.cs (1)
30Content = new StringContent("Test")
Microsoft.AspNetCore.TestHost (1)
ClientHandler.cs (1)
217response.Content = new StreamContent(httpContext.Response.Body);
Microsoft.Build.Tasks.UnitTests (8)
DownloadFile_Tests.cs (8)
40Content = new StringContent(new String('!', 10000000)), 69Content = new StringContent("Success!"), 94Content = new StringContent("Success!") 148Content = new StringContent("Success!"), 212Content = new MockHttpContent(content.Length, stream => 295Content = new StringContent("Success!"), 325Content = new StringContent("C197675A3CC64CAA80680128CF4578C9") 354Content = new StringContent("Success!"),
Microsoft.DotNet.Build.Tasks.Feed.Tests (16)
GeneralTests.cs (3)
122response.Content = new ByteArrayContent(content); 158Content = new ByteArrayContent(responseContent) 162Content = new ByteArrayContent(responseContent)
PublishToSymbolServerTest.cs (13)
241Content = new ByteArrayContent(responseContent) 278Content = new ByteArrayContent(responseContent) 282Content = new ByteArrayContent(responseContent) 286Content = new ByteArrayContent(responseContent) 321Content = new ByteArrayContent(responseContent) 325Content = new ByteArrayContent(responseContent) 329Content = new ByteArrayContent(responseContent) 364Content = new ByteArrayContent(responseContent) 368Content = new ByteArrayContent(responseContent) 400Content = new ByteArrayContent(responseContent) 429Content = new ByteArrayContent(responseContent) 433Content = new ByteArrayContent(responseContent) 437Content = new ByteArrayContent(responseContent)
Microsoft.DotNet.Helix.Sdk.Tests (8)
FindDotNetCliPackageTests.cs (8)
28ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 38ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 76ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 126ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 179ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 189ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102")} 245ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102") } 255ResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent("6.0.102") }
Microsoft.Extensions.Http.Diagnostics (1)
Logging\Internal\HttpResponseBodyReader.cs (1)
118response.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 (21)
Logging\HttpClientLoggerTest.cs (6)
196Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 290Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 396Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 492Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 606Content = new StringContent(responseContent, Encoding.UTF8, TextPlain), 876Content = responseContent,
Logging\HttpHeadersReaderTest.cs (1)
145using var httpResponse = new HttpResponseMessage { Content = responseContent };
Logging\HttpRequestReaderTest.cs (7)
93Content = new StringContent(responseContent, Encoding.UTF8) 153Content = new StringContent(responseContent, Encoding.UTF8) 222Content = new StringContent(responseContent, Encoding.UTF8) 297Content = new StringContent(responseContent, Encoding.UTF8) 427Content = new StringContent(responseContent, Encoding.UTF8) 494Content = new StringContent(responseContent, Encoding.UTF8) 562Content = new StringContent(responseContent, Encoding.UTF8)
Logging\HttpResponseBodyReaderTest.cs (6)
42Content = new StringContent(expectedContentBody, Encoding.UTF8, "text/plain") 60Content = new StreamContent(new MemoryStream()) 85Content = new StringContent(expectedContentBody, Encoding.UTF8, contentType) 105Content = new StringContent(input, Encoding.UTF8, "text/plain") 129Content = new StringContent(bigContent, Encoding.UTF8, "text/plain") 154Content = new StreamContent(streamMock.Object)
Logging\Internal\NoRemoteCallHandler.cs (1)
35Content = new StreamContent(new MemoryStream(_fileContent))
Microsoft.Extensions.Http.Polly.Tests (2)
PolicyHttpMessageHandlerTest.cs (2)
114Content = fakeContent, 164Content = fakeContent,
System.Net.Http (6)
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (3)
83response.Content = new GZipDecompressedContent(response.Content); 87response.Content = new DeflateDecompressedContent(response.Content); 91response.Content = new BrotliDecompressedContent(response.Content);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (1)
141Content = new HttpConnectionResponseContent()
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
1043Content = new HttpConnectionResponseContent(),
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
663var response = new HttpResponseMessage() { RequestMessage = request, Content = new HttpConnectionResponseContent() };
2190 references to Content
Aspire.Dashboard.Tests (15)
Integration\FrontendBrowserTokenAuthTests.cs (1)
152var actualResult = await response.Content.ReadFromJsonAsync<bool>();
Integration\OtlpHttpServiceTests.cs (10)
50var response = ExportLogsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 53Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 176var response = ExportLogsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 179Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 291var response = ExportLogsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync()); 294Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 320var response = ExportTraceServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 323Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single()); 349var response = ExportMetricsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 352Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single());
Integration\ResponseCompressionTests.cs (2)
32Assert.DoesNotContain(response.Content.Headers, h => h.Key == "Content-Encoding"); 54Assert.Contains(response.Content.Headers, h => h.Key == "Content-Encoding" && h.Value.Contains("br"));
Integration\StartupTests.cs (2)
410var response = ExportLogsServiceResponse.Parser.ParseFrom(await responseMessage.Content.ReadAsByteArrayAsync().DefaultTimeout()); 412Assert.Equal(OtlpHttpEndpointsBuilder.ProtobufContentType, responseMessage.Content.Headers.GetValues("content-type").Single());
Aspire.EndToEnd.Tests (2)
IntegrationServicesTests.cs (1)
34var responseContent = await response.Content.ReadAsStringAsync();
tests\Shared\WorkloadTesting\AspireProject.cs (1)
483if (args.Outcome.Result?.Content is HttpContent content && (await content.ReadAsStringAsync()) is string contentStr)
Aspire.Hosting (1)
Dcp\DcpKubernetesClient.cs (1)
77Body = await httpResponse.Content.ReadAsStreamAsync(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)
263var databases = await response.Content.ReadFromJsonAsync<List<RedisInsightDatabaseModel>>(cts.Token); 668var content = await response.Content.ReadAsStringAsync(ct);
Aspire.Workload.Tests (1)
tests\Shared\WorkloadTesting\AspireProject.cs (1)
483if (args.Outcome.Result?.Content is HttpContent content && (await content.ReadAsStringAsync()) is string contentStr)
AuthSamples.FunctionalTests (36)
ClaimsTransformTests.cs (2)
26var content = await response.Content.ReadAsStringAsync(); 37var content = await response.Content.ReadAsStringAsync();
CookiesTests.cs (5)
25var content = await response.Content.ReadAsStringAsync(); 36var content = await response.Content.ReadAsStringAsync(); 59var content = await response.Content.ReadAsStringAsync(); 63content = await response.Content.ReadAsStringAsync(); 73var content = await response.Content.ReadAsStringAsync();
CustomAuthorizationFailureResponseTests.cs (2)
25var content = await response.Content.ReadAsStringAsync(); 35var content = await response.Content.ReadAsStringAsync();
CustomPolicyProviderTests.cs (7)
29var content = await response.Content.ReadAsStringAsync(); 40var content = await response.Content.ReadAsStringAsync(); 55var content = await response.Content.ReadAsStringAsync(); 71var content = await response.Content.ReadAsStringAsync(); 86var content = await response.Content.ReadAsStringAsync(); 102var content = await response.Content.ReadAsStringAsync(); 114var content = await response.Content.ReadAsStringAsync();
DynamicSchemeTests.cs (6)
27var content = await response.Content.ReadAsStringAsync(); 38var content = await response.Content.ReadAsStringAsync(); 44content = await response.Content.ReadAsStringAsync(); 52content = await response.Content.ReadAsStringAsync(); 62content = await response.Content.ReadAsStringAsync(); 71content = await response.Content.ReadAsStringAsync();
IdentityExternalClaimsTests.cs (2)
26var content = await response.Content.ReadAsStringAsync(); 37var content = await response.Content.ReadAsStringAsync();
PathSchemeSelectionTests.cs (7)
27var content = await response.Content.ReadAsStringAsync(); 38var content = await response.Content.ReadAsStringAsync(); 49var content = await response.Content.ReadAsStringAsync(); 61var content = await response.Content.ReadAsStringAsync(); 85var content = await response.Content.ReadAsStringAsync(); 89content = await response.Content.ReadAsStringAsync(); 99var content = await response.Content.ReadAsStringAsync();
StaticFilesAuthTests.cs (2)
25var content = await response.Content.ReadAsStringAsync(); 36var content = await response.Content.ReadAsStringAsync();
TestAssert.cs (3)
76Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 77var content = await response.Content.ReadAsStringAsync(); 89MapHeaders(response.Content.Headers);
BasicWebSite (1)
Services\WeatherForecastService.cs (1)
23var dataString = await result.Content.ReadAsStringAsync();
Diagnostics.EFCore.FunctionalTests (13)
DatabaseErrorPageMiddlewareTest.cs (9)
45Assert.Equal("Request Handled", await response.Content.ReadAsStringAsync()); 142var content = await response.Content.ReadAsStringAsync(); 204var content = await response.Content.ReadAsStringAsync(); 243var content = await response.Content.ReadAsStringAsync(); 287var content = await response.Content.ReadAsStringAsync(); 301content = await response.Content.ReadAsStringAsync(); 307content = await response.Content.ReadAsStringAsync(); 366var content = await response.Content.ReadAsStringAsync(); 488var content = await response.Content.ReadAsStringAsync();
MigrationsEndPointMiddlewareTest.cs (4)
42Assert.Equal("Request Handled", await response.Content.ReadAsStringAsync()); 162var content = await response.Content.ReadAsStringAsync(); 194var content = await response.Content.ReadAsStringAsync(); 223var content = await response.Content.ReadAsStringAsync();
Diagnostics.FunctionalTests (14)
DatabaseErrorPageSampleTest.cs (1)
31var body = await response.Content.ReadAsStringAsync();
DeveloperExceptionPageSampleTest.cs (2)
32var body = await response.Content.ReadAsStringAsync(); 48var body = await response.Content.ReadFromJsonAsync<ProblemDetails>();
ExceptionHandlerSampleTest.cs (1)
28var body = await response.Content.ReadAsStringAsync();
MiddlewareAnalysisSampleTest.cs (1)
28var body = await response.Content.ReadAsStringAsync();
ProblemDetailsExceptionHandlerSampleTest.cs (2)
33var body = await response.Content.ReadFromJsonAsync<ProblemDetails>(); 50var body = await response.Content.ReadFromJsonAsync<ProblemDetails>();
StatusCodeSampleTest.cs (5)
33var body = await response.Content.ReadAsStringAsync(); 48var responseBody = await response.Content.ReadAsStringAsync(); 68var responseBody = await response.Content.ReadAsStringAsync(); 88var body = await response.Content.ReadFromJsonAsync<ProblemDetails>(); 105var body = await response.Content.ReadFromJsonAsync<ProblemDetails>();
WelcomePageSampleTest.cs (2)
25var bytes = await response.Content.ReadAsByteArrayAsync(); 29var body = await response.Content.ReadAsStringAsync();
dotnet-openapi (1)
HttpClientWrapper.cs (1)
51public Task<Stream> Stream => _response.Content.ReadAsStreamAsync();
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;
HeaderPropagationSample (1)
Startup.cs (1)
85await context.Response.WriteAsync(await response.Content.ReadAsStringAsync());
HttpClientApp (2)
Program.cs (2)
24Console.WriteLine(await response.Content.ReadAsStringAsync()); 29Console.WriteLine(await response.Content.ReadAsStringAsync());
HttpStress (12)
Program.cs (12)
178ValidateContent(contentSource, await m.Content.ReadAsStringAsync()); 207ValidateContent(contentSource, await m.Content.ReadAsStringAsync()); 226ValidateContent(contentSource, await m.Content.ReadAsStringAsync()); 247ValidateContent(content, await m.Content.ReadAsStringAsync()); 261ValidateContent(content, await m.Content.ReadAsStringAsync()); 275ValidateContent(content, await m.Content.ReadAsStringAsync()); 291ValidateContent(content, await m.Content.ReadAsStringAsync()); 314ValidateContent(content, await m.Content.ReadAsStringAsync()); 329if (m.Content.Headers.ContentLength != maxContentLength) 331throw new Exception($"Expected {maxContentLength}, got {m.Content.Headers.ContentLength}"); 333string r = await m.Content.ReadAsStringAsync(); 351string r = await m.Content.ReadAsStringAsync();
IIS.FunctionalTests (54)
Http2TrailersResetTests.cs (7)
87Assert.Equal("Hello World", await response.Content.ReadAsStringAsync()); 102Assert.Equal(body, await response.Content.ReadAsStringAsync()); 118Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength); 120Assert.Equal(body + body, await response.Content.ReadAsStringAsync()); 136Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength); 139Assert.Equal(body, await response.Content.ReadAsStringAsync()); 182Assert.Equal("Hello World", await response.Content.ReadAsStringAsync());
Http3Tests.cs (7)
54Assert.Equal("HTTP/3", await response.Content.ReadAsStringAsync()); 72Assert.Equal("HTTP/1.1", await response1.Content.ReadAsStringAsync()); 78Assert.Equal("HTTP/3", await response3.Content.ReadAsStringAsync()); 95Assert.Equal("HTTP/2", await response2.Content.ReadAsStringAsync()); 111var result = await response.Content.ReadAsStringAsync(); 139var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync()); 156var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync());
src\Servers\IIS\IIS\test\Common.FunctionalTests\BasicAuthTests.cs (1)
66var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (3)
143Assert.Equal(messages, await response.Content.ReadAsStringAsync()); 144Assert.True(response.Content.Headers.TryGetValues("Content-Type", out var contentTypes)); 148Assert.Contains("gzip", response.Content.GetType().FullName, StringComparison.OrdinalIgnoreCase);
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (1)
108await result.HttpClient.RetryRequestAsync("/WaitingRequestCount", async message => await message.Content.ReadAsStringAsync() == "1");
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
53var responseText = await response.Content.ReadAsStringAsync(); 77var responseText = await response.Content.ReadAsStringAsync(); 101var responseString = await response.Content.ReadAsStringAsync(); 123var responseText = await response.Content.ReadAsStringAsync(); 147var responseText = await response.Content.ReadAsStringAsync(); 168var responseText = await response.Content.ReadAsStringAsync(); 184responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (1)
91var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
30var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
54Assert.Equal(expectedResponse, await response.Content.ReadAsStringAsync()); 69var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\HttpSysRequestInfoTests.cs (1)
39var timings = await response.Content.ReadFromJsonAsync<long[]>();
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (2)
67Assert.Contains("500.35", await result2.Content.ReadAsStringAsync()); 94Assert.Contains("500.34", await result2.Content.ReadAsStringAsync());
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (20)
132Assert.Equal("gzip", response.Content.Headers.ContentEncoding.Single()); 138await response.Content.ReadAsByteArrayAsync()); 150Assert.Equal("gzip", response.Content.Headers.ContentEncoding.Single()); 156await response.Content.ReadAsByteArrayAsync()); 166var responseText = await response.Content.ReadAsStringAsync(); 178var responseText = await response.Content.ReadAsStringAsync(); 189var responseText = await response.Content.ReadAsStringAsync(); 200var responseText = await response.Content.ReadAsStringAsync(); 211var responseText = await response.Content.ReadAsStringAsync(); 437var text = response.Content.ReadAsStringAsync().Result; 454Assert.Equal("Hello World", await result.Content.ReadAsStringAsync()); 484Assert.Equal("Success", await result.Content.ReadAsStringAsync()); 510Assert.Equal("Success", await result.Content.ReadAsStringAsync()); 517var responseText = await response.Content.ReadAsStringAsync(); 526var responseText = await response.Content.ReadAsStringAsync(); 533Assert.True(response.Content.Headers.TryGetValues(Net.Http.Headers.HeaderNames.ContentType, out headerValues)); 573Assert.Equal(body ?? string.Empty, await response.Content.ReadAsStringAsync()); 692var responseText = await response.Content.ReadAsStringAsync(); 708await _fixture.Client.RetryRequestAsync("/WaitingRequestCount", async message => await message.Content.ReadAsStringAsync() == "1"); 711await _fixture.Client.RetryRequestAsync("/WaitingRequestCount", async message => await message.Content.ReadAsStringAsync() == "0");
src\Servers\IIS\IIS\test\Common.FunctionalTests\WindowsAuthTests.cs (1)
56var responseText = await response.Content.ReadAsStringAsync();
IIS.LongTests (32)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
30var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
54Assert.Equal(expectedResponse, await response.Content.ReadAsStringAsync()); 69var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (9)
146Assert.Contains("500.0", await result.Content.ReadAsStringAsync()); 165Assert.Contains("502.5", await result.Content.ReadAsStringAsync()); 183Assert.Contains("500.30", await result.Content.ReadAsStringAsync()); 418Logger.LogError($"Status code was a bad request. Content: {response.Content.ReadAsStringAsync().GetAwaiter().GetResult()}"); 478await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() != processBefore); 498await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 518await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 537await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 624Assert.Contains("0x80072efe", await response.Content.ReadAsStringAsync());
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (20)
77Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); 81Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); 430var responseContent = await response.Content.ReadAsStringAsync(); 491var responseContent = await response.Content.ReadAsStringAsync(); 523var responseContent = await response.Content.ReadAsStringAsync(); 775var content = await result.Content.ReadAsStringAsync(); 799var content = await result.Content.ReadAsStringAsync(); 822var content = await result.Content.ReadAsStringAsync(); 847var content = await result.Content.ReadAsStringAsync(); 869var content = await result.Content.ReadAsStringAsync(); 888var content = await result.Content.ReadAsStringAsync(); 906var content = await result.Content.ReadAsStringAsync(); 1064var responseText = await response.Content.ReadAsStringAsync(); 1079var responseString = await response.Content.ReadAsStringAsync(); 1098var responseString = await response.Content.ReadAsStringAsync(); 1121var responseString = await response.Content.ReadAsStringAsync(); 1144var responseString = await response.Content.ReadAsStringAsync(); 1488Assert.Contains("<a href=\"http://example\"> <cite> http://example </cite></a> and ", await response.Content.ReadAsStringAsync()); 1583Assert.Contains(error, await response.Content.ReadAsStringAsync()); 1598var responseText = await response.Content.ReadAsStringAsync();
IIS.NewHandler.FunctionalTests (32)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
30var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
54Assert.Equal(expectedResponse, await response.Content.ReadAsStringAsync()); 69var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (9)
146Assert.Contains("500.0", await result.Content.ReadAsStringAsync()); 165Assert.Contains("502.5", await result.Content.ReadAsStringAsync()); 183Assert.Contains("500.30", await result.Content.ReadAsStringAsync()); 418Logger.LogError($"Status code was a bad request. Content: {response.Content.ReadAsStringAsync().GetAwaiter().GetResult()}"); 478await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() != processBefore); 498await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 518await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 537await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 624Assert.Contains("0x80072efe", await response.Content.ReadAsStringAsync());
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (20)
77Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); 81Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); 430var responseContent = await response.Content.ReadAsStringAsync(); 491var responseContent = await response.Content.ReadAsStringAsync(); 523var responseContent = await response.Content.ReadAsStringAsync(); 775var content = await result.Content.ReadAsStringAsync(); 799var content = await result.Content.ReadAsStringAsync(); 822var content = await result.Content.ReadAsStringAsync(); 847var content = await result.Content.ReadAsStringAsync(); 869var content = await result.Content.ReadAsStringAsync(); 888var content = await result.Content.ReadAsStringAsync(); 906var content = await result.Content.ReadAsStringAsync(); 1064var responseText = await response.Content.ReadAsStringAsync(); 1079var responseString = await response.Content.ReadAsStringAsync(); 1098var responseString = await response.Content.ReadAsStringAsync(); 1121var responseString = await response.Content.ReadAsStringAsync(); 1144var responseString = await response.Content.ReadAsStringAsync(); 1488Assert.Contains("<a href=\"http://example\"> <cite> http://example </cite></a> and ", await response.Content.ReadAsStringAsync()); 1583Assert.Contains(error, await response.Content.ReadAsStringAsync()); 1598var responseText = await response.Content.ReadAsStringAsync();
IIS.NewShim.FunctionalTests (32)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
30var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
54Assert.Equal(expectedResponse, await response.Content.ReadAsStringAsync()); 69var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (9)
146Assert.Contains("500.0", await result.Content.ReadAsStringAsync()); 165Assert.Contains("502.5", await result.Content.ReadAsStringAsync()); 183Assert.Contains("500.30", await result.Content.ReadAsStringAsync()); 418Logger.LogError($"Status code was a bad request. Content: {response.Content.ReadAsStringAsync().GetAwaiter().GetResult()}"); 478await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() != processBefore); 498await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 518await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 537await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 621Assert.Contains("0x80072f78", await response.Content.ReadAsStringAsync());
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (20)
77Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); 81Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); 430var responseContent = await response.Content.ReadAsStringAsync(); 491var responseContent = await response.Content.ReadAsStringAsync(); 523var responseContent = await response.Content.ReadAsStringAsync(); 775var content = await result.Content.ReadAsStringAsync(); 799var content = await result.Content.ReadAsStringAsync(); 822var content = await result.Content.ReadAsStringAsync(); 847var content = await result.Content.ReadAsStringAsync(); 869var content = await result.Content.ReadAsStringAsync(); 888var content = await result.Content.ReadAsStringAsync(); 906var content = await result.Content.ReadAsStringAsync(); 1064var responseText = await response.Content.ReadAsStringAsync(); 1079var responseString = await response.Content.ReadAsStringAsync(); 1098var responseString = await response.Content.ReadAsStringAsync(); 1121var responseString = await response.Content.ReadAsStringAsync(); 1144var responseString = await response.Content.ReadAsStringAsync(); 1488Assert.Contains("<a href=\"http://example\"> <cite> http://example </cite></a> and ", await response.Content.ReadAsStringAsync()); 1583Assert.Contains(error, await response.Content.ReadAsStringAsync()); 1598var responseText = await response.Content.ReadAsStringAsync();
IIS.ShadowCopy.Tests (3)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
30var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
54Assert.Equal(expectedResponse, await response.Content.ReadAsStringAsync()); 69var responseText = await response.Content.ReadAsStringAsync();
IIS.Tests (2)
ResponseBodySizeTests.cs (1)
28var content = await response.Content.ReadAsByteArrayAsync();
TestServerTest.cs (1)
31Assert.Equal(helloWorld, await result.Content.ReadAsStringAsync());
IISExpress.FunctionalTests (81)
InProcess\AuthenticationTests.cs (6)
33var responseText = await response.Content.ReadAsStringAsync(); 38responseText = await response.Content.ReadAsStringAsync(); 44responseText = await response.Content.ReadAsStringAsync(); 51responseText = await response.Content.ReadAsStringAsync(); 58responseText = await response.Content.ReadAsStringAsync(); 63responseText = await response.Content.ReadAsStringAsync();
OutOfProcess\MultipleAppTests.cs (1)
56var responseText = await response.Content.ReadAsStringAsync();
OutOfProcess\NtlmAuthentationTest.cs (4)
47var responseText = await response.Content.ReadAsStringAsync(); 53responseText = await response.Content.ReadAsStringAsync(); 75responseText = await response.Content.ReadAsStringAsync(); 80responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\BasicAuthTests.cs (1)
66var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (3)
143Assert.Equal(messages, await response.Content.ReadAsStringAsync()); 144Assert.True(response.Content.Headers.TryGetValues("Content-Type", out var contentTypes)); 148Assert.Contains("gzip", response.Content.GetType().FullName, StringComparison.OrdinalIgnoreCase);
src\Servers\IIS\IIS\test\Common.FunctionalTests\FrebTests.cs (1)
108await result.HttpClient.RetryRequestAsync("/WaitingRequestCount", async message => await message.Content.ReadAsStringAsync() == "1");
src\Servers\IIS\IIS\test\Common.FunctionalTests\GlobalVersionTests.cs (7)
53var responseText = await response.Content.ReadAsStringAsync(); 77var responseText = await response.Content.ReadAsStringAsync(); 101var responseString = await response.Content.ReadAsStringAsync(); 123var responseText = await response.Content.ReadAsStringAsync(); 147var responseText = await response.Content.ReadAsStringAsync(); 168var responseText = await response.Content.ReadAsStringAsync(); 184responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\HttpsTests.cs (1)
91var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
30var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\IISFunctionalTestBase.cs (2)
54Assert.Equal(expectedResponse, await response.Content.ReadAsStringAsync()); 69var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.FunctionalTests\Inprocess\HttpSysRequestInfoTests.cs (1)
39var timings = await response.Content.ReadFromJsonAsync<long[]>();
src\Servers\IIS\IIS\test\Common.FunctionalTests\MultiApplicationTests.cs (2)
67Assert.Contains("500.35", await result2.Content.ReadAsStringAsync()); 94Assert.Contains("500.34", await result2.Content.ReadAsStringAsync());
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (20)
132Assert.Equal("gzip", response.Content.Headers.ContentEncoding.Single()); 138await response.Content.ReadAsByteArrayAsync()); 150Assert.Equal("gzip", response.Content.Headers.ContentEncoding.Single()); 156await response.Content.ReadAsByteArrayAsync()); 166var responseText = await response.Content.ReadAsStringAsync(); 178var responseText = await response.Content.ReadAsStringAsync(); 189var responseText = await response.Content.ReadAsStringAsync(); 200var responseText = await response.Content.ReadAsStringAsync(); 211var responseText = await response.Content.ReadAsStringAsync(); 437var text = response.Content.ReadAsStringAsync().Result; 454Assert.Equal("Hello World", await result.Content.ReadAsStringAsync()); 484Assert.Equal("Success", await result.Content.ReadAsStringAsync()); 510Assert.Equal("Success", await result.Content.ReadAsStringAsync()); 517var responseText = await response.Content.ReadAsStringAsync(); 526var responseText = await response.Content.ReadAsStringAsync(); 533Assert.True(response.Content.Headers.TryGetValues(Net.Http.Headers.HeaderNames.ContentType, out headerValues)); 573Assert.Equal(body ?? string.Empty, await response.Content.ReadAsStringAsync()); 692var responseText = await response.Content.ReadAsStringAsync(); 708await _fixture.Client.RetryRequestAsync("/WaitingRequestCount", async message => await message.Content.ReadAsStringAsync() == "1"); 711await _fixture.Client.RetryRequestAsync("/WaitingRequestCount", async message => await message.Content.ReadAsStringAsync() == "0");
src\Servers\IIS\IIS\test\Common.FunctionalTests\WindowsAuthTests.cs (1)
56var responseText = await response.Content.ReadAsStringAsync();
src\Servers\IIS\IIS\test\Common.LongTests\ShutdownTests.cs (9)
146Assert.Contains("500.0", await result.Content.ReadAsStringAsync()); 165Assert.Contains("502.5", await result.Content.ReadAsStringAsync()); 183Assert.Contains("500.30", await result.Content.ReadAsStringAsync()); 418Logger.LogError($"Status code was a bad request. Content: {response.Content.ReadAsStringAsync().GetAwaiter().GetResult()}"); 478await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() != processBefore); 498await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 518await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 537await deploymentResult.HttpClient.RetryRequestAsync("/ProcessId", async r => await r.Content.ReadAsStringAsync() == processBefore); 624Assert.Contains("0x80072efe", await response.Content.ReadAsStringAsync());
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (20)
77Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); 81Assert.Contains("500.0", await response.Content.ReadAsStringAsync()); 430var responseContent = await response.Content.ReadAsStringAsync(); 491var responseContent = await response.Content.ReadAsStringAsync(); 523var responseContent = await response.Content.ReadAsStringAsync(); 775var content = await result.Content.ReadAsStringAsync(); 799var content = await result.Content.ReadAsStringAsync(); 822var content = await result.Content.ReadAsStringAsync(); 847var content = await result.Content.ReadAsStringAsync(); 869var content = await result.Content.ReadAsStringAsync(); 888var content = await result.Content.ReadAsStringAsync(); 906var content = await result.Content.ReadAsStringAsync(); 1064var responseText = await response.Content.ReadAsStringAsync(); 1079var responseString = await response.Content.ReadAsStringAsync(); 1098var responseString = await response.Content.ReadAsStringAsync(); 1121var responseString = await response.Content.ReadAsStringAsync(); 1144var responseString = await response.Content.ReadAsStringAsync(); 1488Assert.Contains("<a href=\"http://example\"> <cite> http://example </cite></a> and ", await response.Content.ReadAsStringAsync()); 1583Assert.Contains(error, await response.Content.ReadAsStringAsync()); 1598var responseText = await response.Content.ReadAsStringAsync();
UpgradeFeatureDetectionTests.cs (1)
75var responseText = await response.Content.ReadAsStringAsync();
Infrastructure.Common (3)
ServiceUtilHelper.cs (3)
545return response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); 557return response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult(); 569return await response.Content.ReadAsByteArrayAsync();
InMemory.FunctionalTests (3)
Http2\Http2EndToEndTests.cs (1)
74Assert.Equal("hello, world", await responseMessage.Content.ReadAsStringAsync());
KestrelMetricsTests.cs (2)
576responseStream = await responseMessage.Content.ReadAsStreamAsync(); 819var stream = await responseMessage.Content.ReadAsStreamAsync().DefaultTimeout();
installer.tasks (1)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
80string tpnContent = await response.Content.ReadAsStringAsync();
Interop.FunctionalTests (44)
Http2\Http2RequestTests.cs (2)
218Assert.Equal("An HTTP/1.x request was sent to an HTTP/2 only endpoint.", await responseMessage.Content.ReadAsStringAsync()); 301var responseStream = await responseMessage.Content.ReadAsStreamAsync();
Http3\Http3RequestTests.cs (11)
156Assert.Equal("hello, world", await responseMessage.Content.ReadAsStringAsync()); 261var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 390await response.Content.ReadAsByteArrayAsync(); 439var responseText = await response.Content.ReadAsStringAsync().DefaultTimeout(); 635await response.Content.ReadAsByteArrayAsync(); 740var responseText = await response.Content.ReadAsStringAsync().DefaultTimeout(); 1031var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1125var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1323var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1377var responseStream = await response.Content.ReadAsStreamAsync(); 2166var data = await response.Content.ReadAsByteArrayAsync();
Http3\Http3TlsTests.cs (7)
63var result = await response.Content.ReadAsStringAsync(); 109var result = await response.Content.ReadAsStringAsync(); 151var result = await response.Content.ReadAsStringAsync(); 211Assert.Equal("True", await response.Content.ReadAsStringAsync().DefaultTimeout()); 250Assert.Equal("False", await response.Content.ReadAsStringAsync()); 329var result = await response.Content.ReadAsStringAsync(); 494var result = await response.Content.ReadAsStringAsync();
HttpClientHttp2InteropTests.cs (24)
66Assert.Equal("Hello World", await response.Content.ReadAsStringAsync()); 95await BulkContent.VerifyContent(await response.Content.ReadAsStreamAsync().DefaultTimeout()); 140await BulkContent.VerifyContent(await response.Content.ReadAsStreamAsync()).DefaultTimeout(); 189await BulkContent.VerifyContent(await response.Content.ReadAsStreamAsync().DefaultTimeout()); 305var stream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 382var stream = await response.Content.ReadAsStreamAsync(); 441var read = await response.Content.ReadAsStringAsync().DefaultTimeout(); 540Assert.Equal("", await response.Content.ReadAsStringAsync()); 573var responseBody = await response.Content.ReadAsStringAsync().DefaultTimeout(); 628var exception = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync()).DefaultTimeout(); 655var body = await response.Content.ReadAsStringAsync().DefaultTimeout(); 685var responseBody = await response.Content.ReadAsStringAsync().DefaultTimeout(); 741var responseEx = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync().DefaultTimeout()); 800var responseEx = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync().DefaultTimeout()); 973var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1014var responseStream = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 1332Assert.Equal("Hello World", await response.Content.ReadAsStringAsync()); 1447Assert.Equal("Hello World", await response.Content.ReadAsStringAsync()); 1537Assert.Equal("Hello World", await response0.Content.ReadAsStringAsync()); 1538Assert.Equal("Hello World", await response1.Content.ReadAsStringAsync()); 1570Assert.Equal("點.看", await response.Content.ReadAsStringAsync()); 1592Assert.Equal("/ !\"$%&'()*++,-./0123456789:;<>=@ABCDEFGHIJKLMNOPQRSTUVWXYZ[/]^_`{|}~點看", await response.Content.ReadAsStringAsync()); 1637Assert.Equal("Hello World", await response.Content.ReadAsStringAsync()); 1682Assert.Equal("Hello World", await response.Content.ReadAsStringAsync());
JwtClientSample (1)
Program.cs (1)
86return await httpResponse.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)
611var contentType = parResponseMessage.Content.Headers.ContentType; 618var parResponseString = await parResponseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 996var contentMediaType = responseMessage.Content.Headers.ContentType?.MediaType; 1005Logger.LogDebug($"Unexpected token response format. Status Code: {(int)responseMessage.StatusCode}. Content-Type {responseMessage.Content.Headers.ContentType}."); 1016var responseContent = await responseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 1021throw new OpenIdConnectProtocolException($"Failed to parse token response body as JSON. Status Code: {(int)responseMessage.StatusCode}. Content-Type: {responseMessage.Content.Headers.ContentType}", ex); 1062var userInfoResponse = await responseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 1065var contentType = responseMessage.Content.Headers.ContentType;
Microsoft.AspNetCore.Authentication.Test (120)
CertificateTests.cs (28)
469if (response.Content != null && 470response.Content.Headers.ContentType != null && 471response.Content.Headers.ContentType.MediaType == "text/xml") 473var responseContent = await response.Content.ReadAsStringAsync(); 600if (response.Content != null && 601response.Content.Headers.ContentType != null && 602response.Content.Headers.ContentType.MediaType == "text/xml") 604var responseContent = await response.Content.ReadAsStringAsync(); 619if (response.Content != null && 620response.Content.Headers.ContentType != null && 621response.Content.Headers.ContentType.MediaType == "text/xml") 623var responseContent = await response.Content.ReadAsStringAsync(); 670if (response.Content != null && 671response.Content.Headers.ContentType != null && 672response.Content.Headers.ContentType.MediaType == "text/xml") 674var responseContent = await response.Content.ReadAsStringAsync(); 727if (response.Content != null && 728response.Content.Headers.ContentType != null && 729response.Content.Headers.ContentType.MediaType == "text/xml") 731var responseContent = await response.Content.ReadAsStringAsync(); 746if (response.Content != null && 747response.Content.Headers.ContentType != null && 748response.Content.Headers.ContentType.MediaType == "text/xml") 750var responseContent = await response.Content.ReadAsStringAsync(); 768if (response.Content != null && 769response.Content.Headers.ContentType != null && 770response.Content.Headers.ContentType.MediaType == "text/xml") 772var responseContent = await response.Content.ReadAsStringAsync();
CookieTests.cs (4)
1923transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 1925if (transaction.Response.Content != null && 1926transaction.Response.Content.Headers.ContentType != null && 1927transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
JwtBearerTests.cs (9)
120Assert.Equal(tokenText, await response.Response.Content.ReadAsStringAsync()); 863Assert.Equal("You Shall Not Pass", await response.Response.Content.ReadAsStringAsync()); 912Assert.Equal("You Shall Not Pass", await response.Content.ReadAsStringAsync()); 953var responseBody = await response.Response.Content.ReadAsStringAsync(); 997var responseBody = await response.Response.Content.ReadAsStringAsync(); 1262transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 1264if (transaction.Response.Content != null && 1265transaction.Response.Content.Headers.ContentType != null && 1266transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
JwtBearerTests_Handler.cs (9)
110Assert.Equal(tokenText, await response.Response.Content.ReadAsStringAsync()); 808Assert.Equal("You Shall Not Pass", await response.Response.Content.ReadAsStringAsync()); 857Assert.Equal("You Shall Not Pass", await response.Content.ReadAsStringAsync()); 897var responseBody = await response.Response.Content.ReadAsStringAsync(); 940var responseBody = await response.Response.Content.ReadAsStringAsync(); 1321transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 1323if (transaction.Response.Content != null && 1324transaction.Response.Content.Headers.ContentType != null && 1325transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
OpenIdConnect\OpenIdConnectChallengeTests.cs (2)
165Assert.Equal("text/html", transaction.Response.Content.Headers.ContentType.MediaType); 167var body = await res.Content.ReadAsStringAsync();
OpenIdConnect\OpenIdConnectEventTests.cs (26)
48Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 94Assert.Equal("", await response.Content.ReadAsStringAsync()); 116Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 165Assert.Equal("", await response.Content.ReadAsStringAsync()); 201Assert.Equal("", await response.Content.ReadAsStringAsync()); 224Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 275Assert.Equal("", await response.Content.ReadAsStringAsync()); 305Assert.Equal("", await response.Content.ReadAsStringAsync()); 329Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 382Assert.Equal("", await response.Content.ReadAsStringAsync()); 413Assert.Equal("", await response.Content.ReadAsStringAsync()); 437Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 490Assert.Equal("", await response.Content.ReadAsStringAsync()); 521Assert.Equal("", await response.Content.ReadAsStringAsync()); 546Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 601Assert.Equal("", await response.Content.ReadAsStringAsync()); 633Assert.Equal("", await response.Content.ReadAsStringAsync()); 664Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 731Assert.Equal("", await response.Content.ReadAsStringAsync()); 779Assert.Equal("", await response.Content.ReadAsStringAsync()); 801Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 825Assert.Equal("", await response.Content.ReadAsStringAsync()); 862Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 896Assert.Equal("", await response.Content.ReadAsStringAsync()); 922Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 949Assert.Equal("", await response.Content.ReadAsStringAsync());
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (26)
48Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 94Assert.Equal("", await response.Content.ReadAsStringAsync()); 116Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 165Assert.Equal("", await response.Content.ReadAsStringAsync()); 201Assert.Equal("", await response.Content.ReadAsStringAsync()); 224Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 275Assert.Equal("", await response.Content.ReadAsStringAsync()); 305Assert.Equal("", await response.Content.ReadAsStringAsync()); 329Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 382Assert.Equal("", await response.Content.ReadAsStringAsync()); 413Assert.Equal("", await response.Content.ReadAsStringAsync()); 437Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 490Assert.Equal("", await response.Content.ReadAsStringAsync()); 521Assert.Equal("", await response.Content.ReadAsStringAsync()); 546Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 601Assert.Equal("", await response.Content.ReadAsStringAsync()); 633Assert.Equal("", await response.Content.ReadAsStringAsync()); 664Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 731Assert.Equal("", await response.Content.ReadAsStringAsync()); 779Assert.Equal("", await response.Content.ReadAsStringAsync()); 801Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 825Assert.Equal("", await response.Content.ReadAsStringAsync()); 862Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 896Assert.Equal("", await response.Content.ReadAsStringAsync()); 922Assert.Equal("/signin-oidc", await response.Content.ReadAsStringAsync()); 949Assert.Equal("", await response.Content.ReadAsStringAsync());
OpenIdConnect\TestServerExtensions.cs (4)
40transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 41if (transaction.Response.Content != null && 42transaction.Response.Content.Headers.ContentType != null && 43transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
TestExtensions.cs (4)
34transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 36if (transaction.Response.Content != null && 37transaction.Response.Content.Headers.ContentType != null && 38transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
WsFederation\WsFederationTest.cs (4)
138Assert.Equal(WsFederationDefaults.AuthenticationScheme, await response.Content.ReadAsStringAsync()); 165Assert.Equal(WsFederationDefaults.AuthenticationScheme, await response.Content.ReadAsStringAsync()); 183Assert.Equal("AuthenticationFailed", await response.Content.ReadAsStringAsync()); 197Assert.Equal("", await response.Content.ReadAsStringAsync());
WsFederation\WsFederationTest_Handler.cs (4)
136Assert.Equal(WsFederationDefaults.AuthenticationScheme, await response.Content.ReadAsStringAsync()); 163Assert.Equal(WsFederationDefaults.AuthenticationScheme, await response.Content.ReadAsStringAsync()); 181Assert.Equal("AuthenticationFailed", await response.Content.ReadAsStringAsync()); 195Assert.Equal("", await response.Content.ReadAsStringAsync());
Microsoft.AspNetCore.Authentication.Twitter (5)
TwitterHandler.cs (5)
275var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 307var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 331var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 358var contentTypeIsJson = string.Equals(response.Content.Headers.ContentType?.MediaType ?? "", "application/json", StringComparison.OrdinalIgnoreCase); 370var errorContentStream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
Microsoft.AspNetCore.CookiePolicy.Test (4)
TestExtensions.cs (4)
31transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 33if (transaction.Response.Content != null && 34transaction.Response.Content.Headers.ContentType != null && 35transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
Microsoft.AspNetCore.Cors.Test (3)
CorsMiddlewareTests.cs (3)
58Assert.Equal("Cross origin response", await response.Content.ReadAsStringAsync()); 100Assert.Equal("Cross origin response", await response.Content.ReadAsStringAsync()); 562Assert.Equal("Cross origin response", await response.Content.ReadAsStringAsync());
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (49)
HealthCheckEndpointRouteBuilderExtensionsTest.cs (4)
81Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 82Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 126Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 127Assert.Equal("Custom!", await response.Content.ReadAsStringAsync());
HealthCheckMiddlewareSampleTest.cs (7)
31Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 32Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 53Assert.Equal("application/json", response.Content.Headers.ContentType.ToString()); 76Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 77Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 98Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 99Assert.Equal("Unhealthy", await response.Content.ReadAsStringAsync());
HealthCheckMiddlewareTests.cs (38)
122Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 123Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 152Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 153Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 185Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 186Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 218Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 219Assert.Equal("Degraded", await response.Content.ReadAsStringAsync()); 251Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 252Assert.Equal("Unhealthy", await response.Content.ReadAsStringAsync()); 284Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 285Assert.Equal("Unhealthy", await response.Content.ReadAsStringAsync()); 329Assert.Equal("application/json", response.Content.Headers.ContentType.ToString()); 331var result = await response.Content.ReadAsStringAsync(); 367Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync()); 402Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 431Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 434Assert.Equal(new string[] { "Thu, 01 Jan 1970 00:00:00 GMT" }, response.Content.Headers.GetValues(HeaderNames.Expires)); 466Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 469Assert.False(response.Content.Headers.Contains(HeaderNames.Expires)); 505Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 506Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 535Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 536Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 593Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 594Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 658Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 659Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 695Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 696Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 733Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 734Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 771Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 772Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 851Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 852Assert.Equal("Healthy", await response.Content.ReadAsStringAsync()); 895Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 896Assert.Equal("Healthy", await response.Content.ReadAsStringAsync());
Microsoft.AspNetCore.Diagnostics.Tests (39)
DeveloperExceptionPageMiddlewareTest.cs (13)
69var body = await response.Content.ReadFromJsonAsync<ProblemDetails>(); 122var body = await response.Content.ReadFromJsonAsync<ProblemDetails>(); 181var body = await response.Content.ReadFromJsonAsync<ProblemDetails>(); 260var responseText = await response.Content.ReadAsStringAsync(); 261Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 295var responseText = await response.Content.ReadAsStringAsync(); 296Assert.Equal("text/plain", response.Content.Headers.ContentType.MediaType); 297Assert.Equal("utf-8", response.Content.Headers.ContentType.CharSet); 333var responseText = await response.Content.ReadAsStringAsync(); 368var responseText = await response.Content.ReadAsStringAsync(); 403Assert.Equal("Test exception", await response.Content.ReadAsStringAsync()); 439Assert.Equal("Bad format exception!", await response.Content.ReadAsStringAsync()); 477Assert.Equal("An error occurred", await response.Content.ReadAsStringAsync());
ExceptionHandlerMiddlewareTest.cs (1)
75var body = await response.Content.ReadFromJsonAsync<ProblemDetails>();
ExceptionHandlerTest.cs (18)
63Assert.Equal("An error occurred while adding a product", await response.Content.ReadAsStringAsync()); 118Assert.Equal("Hello", await response.Content.ReadAsStringAsync()); 184Assert.Equal(expectedResponseBody, await response.Content.ReadAsStringAsync()); 191Assert.True(response.Content.Headers.TryGetValues("Expires", out values)); 240Assert.Equal(expectedResponseBody, await response.Content.ReadAsStringAsync()); 247Assert.True(response.Content.Headers.TryGetValues("Expires", out values)); 295Assert.Equal(expectedResponseBody, await response.Content.ReadAsStringAsync()); 303Assert.True(response.Content.Headers.TryGetValues("Expires", out values)); 367Assert.Equal("Custom 404", await response.Content.ReadAsStringAsync()); 437Assert.Equal("Hello", await response.Content.ReadAsStringAsync()); 445Assert.True(response.Content.Headers.TryGetValues("Expires", out values)); 601Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync()); 650Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync()); 771Assert.Equal("separate pipeline", await response.Content.ReadAsStringAsync()); 822Assert.Equal("Handled", await response.Content.ReadAsStringAsync()); 876Assert.Equal("Handled", await response.Content.ReadAsStringAsync()); 928Assert.Equal("Handled", await response.Content.ReadAsStringAsync()); 986Assert.Equal("Custom handler", await response.Content.ReadAsStringAsync());
StatusCodeMiddlewareTest.cs (7)
66var content = await response.Content.ReadAsStringAsync(); 128var content = await response.Content.ReadAsStringAsync(); 190var content = await response.Content.ReadAsStringAsync(); 279var content = await response.Content.ReadAsStringAsync(); 313var content = await response.Content.ReadAsStringAsync(); 350var content = await response.Content.ReadAsStringAsync(); 388var content = await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.FunctionalTests (5)
WebHostFunctionalTests.cs (5)
41var responseText = await response.Content.ReadAsStringAsync(); 66var responseText = await response.Content.ReadAsStringAsync(); 92var responseText = await response.Content.ReadAsStringAsync(); 167var responseText = await response.Content.ReadAsStringAsync(); 190var responseText = await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.Hosting.FunctionalTests (1)
LinkedApplicationTests.cs (1)
47var body = await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.Http.Connections.Client (4)
HttpConnection.cs (1)
489var 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.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
3260token = await response.Content.ReadAsStringAsync(); 3422token = await response.Content.ReadAsStringAsync(); 3612await response.Content.CopyToAsync(_stream);
Microsoft.AspNetCore.Identity.FunctionalTests (51)
Extensions\ResponseAssert.cs (3)
24Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 25var content = await response.Content.ReadAsStringAsync(); 37MapHeaders(response.Content.Headers);
MapIdentityApiTests.cs (45)
115var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 147var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 182var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 261var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 296var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 300var refreshContent = await refreshResponse.Content.ReadFromJsonAsync<JsonElement>(); 342var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 366var refreshContent = await refreshResponse.Content.ReadFromJsonAsync<JsonElement>(); 370refreshContent = await refreshResponse.Content.ReadFromJsonAsync<JsonElement>(); 415var refreshContent = await refreshResponse.Content.ReadFromJsonAsync<JsonElement>(); 672var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 691var twoFactorKeyContent = await twoFactorKeyResponse.Content.ReadFromJsonAsync<JsonElement>(); 703var enable2faContent = await enable2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 730var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 735var twoFactorKeyContent = await twoFactorKeyResponse.Content.ReadFromJsonAsync<JsonElement>(); 744var enable2faContent = await enable2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 757var recoveryLoginContent = await recoveryLoginResponse.Content.ReadFromJsonAsync<JsonElement>(); 764var disable2faContent = await disable2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 782var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 787var twoFactorKeyContent = await twoFactorKeyResponse.Content.ReadFromJsonAsync<JsonElement>(); 799var enable2faContent = await enable2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 803var resetKeyContent = await resetKeyResponse.Content.ReadFromJsonAsync<JsonElement>(); 816var reenable2faContent = await reenable2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 829var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 834var twoFactorKeyContent = await twoFactorKeyResponse.Content.ReadFromJsonAsync<JsonElement>(); 843var enable2faContent = await enable2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 859var recoveryLoginContent = await recoveryLoginResponse.Content.ReadFromJsonAsync<JsonElement>(); 866var updated2faContent = await updated2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 874var resetRecoveryContent = await resetRecoveryResponse.Content.ReadFromJsonAsync<JsonElement>(); 900var twoFactorKeyContent = await twoFactorKeyResponse.Content.ReadFromJsonAsync<JsonElement>(); 912var enable2faContent = await enable2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 924var session2faContent = await session2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 933var session2faContent2 = await session2faResponse2.Content.ReadFromJsonAsync<JsonElement>(); 942var persistent2faContent = await persistent2faResponse.Content.ReadFromJsonAsync<JsonElement>(); 1056var infoPostContent = await infoPostResponse.Content.ReadFromJsonAsync<JsonElement>(); 1150var infoPostContent = await infoPostResponse.Content.ReadFromJsonAsync<JsonElement>(); 1249var infoPostContent = await infoPostResponse.Content.ReadFromJsonAsync<JsonElement>(); 1395var loginContent = await loginResponse.Content.ReadFromJsonAsync<JsonElement>(); 1431Assert.Equal(0, response.Content.Headers.ContentLength); 1437Assert.Equal(0, response.Content.Headers.ContentLength); 1443Assert.Equal(0, response.Content.Headers.ContentLength); 1449Assert.Equal("application/problem+json", response.Content.Headers.ContentType?.ToString()); 1450var problem = await response.Content.ReadFromJsonAsync<HttpValidationProblemDetails>(); 1459Assert.Equal("application/problem+json", response.Content.Headers.ContentType?.ToString()); 1460var problem = await response.Content.ReadFromJsonAsync<HttpValidationProblemDetails>();
Pages\Account\Login.cs (1)
81var content = await failedLogin.Content.ReadAsStringAsync();
UserStories.cs (2)
200Assert.Contains("Verification email sent.", await response.Content.ReadAsStringAsync()); 271return JsonConvert.DeserializeObject<JObject>(await download.Content.ReadAsStringAsync());
Microsoft.AspNetCore.Identity.InMemory.Test (4)
FunctionalTest.cs (4)
452transaction.ResponseText = await transaction.Response.Content.ReadAsStringAsync(); 454if (transaction.Response.Content != null && 455transaction.Response.Content.Headers.ContentType != null && 456transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
Microsoft.AspNetCore.Localization.FunctionalTests (2)
LocalizationSampleTest.cs (1)
41Assert.Contains("<h1>Bonjour</h1>", await response.Content.ReadAsStringAsync());
LocalizationTest.cs (1)
118Assert.Equal(expected, await response.Content.ReadAsStringAsync());
Microsoft.AspNetCore.Localization.Routing.Tests (3)
RouteDataRequestCultureProviderTest.cs (3)
87var data = await response.Content.ReadAsStringAsync(); 133var data = await response.Content.ReadAsStringAsync(); 209var data = await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.Mvc.FunctionalTests (907)
AntiforgeryTests.cs (5)
58var responseBody = await getResponse.Content.ReadAsStringAsync(); 83Assert.Equal("OK", await response.Content.ReadAsStringAsync()); 110var responseBody = await getResponse.Content.ReadAsStringAsync(); 133Assert.Equal("OK", await response.Content.ReadAsStringAsync()); 141var responseBody = await getResponse.Content.ReadAsStringAsync();
ApiBehaviorTest.cs (17)
62Assert.Equal("application/problem+json", response.Content.Headers.ContentType.MediaType); 64await response.Content.ReadAsStringAsync(), 129var content = await response.Content.ReadAsStringAsync(); 157var result = JsonConvert.DeserializeObject<Contact>(await response.Content.ReadAsStringAsync()); 178var result = JsonConvert.DeserializeObject<ContactRequest>(await response.Content.ReadAsStringAsync()); 194var result = JsonConvert.DeserializeObject<Contact>(await response.Content.ReadAsStringAsync()); 211var result = JsonConvert.DeserializeObject<Contact>(await response.Content.ReadAsStringAsync()); 232var result = await response.Content.ReadAsAsync<Contact>(); 253var result = await response.Content.ReadAsAsync<Contact>(); 270var result = await response.Content.ReadAsStringAsync(); 285var result = await response.Content.ReadAsStringAsync(); 299var content = await response.Content.ReadAsStringAsync(); 328var content = await response.Content.ReadAsStringAsync(); 346var content = await response.Content.ReadAsStringAsync(); 359var content = await response.Content.ReadAsStringAsync(); 451Assert.Equal("application/vnd.error+json", response.Content.Headers.ContentType.MediaType); 452var content = await response.Content.ReadAsStringAsync();
ApiExplorerTest.cs (55)
41var body = await response.Content.ReadAsStringAsync(); 54var body = await response.Content.ReadAsStringAsync(); 67var body = await response.Content.ReadAsStringAsync(); 80var body = await response.Content.ReadAsStringAsync(); 93var body = await response.Content.ReadAsStringAsync(); 107var body = await response.Content.ReadAsStringAsync(); 121var body = await response.Content.ReadAsStringAsync(); 135var body = await response.Content.ReadAsStringAsync(); 149var body = await response.Content.ReadAsStringAsync(); 163var body = await response.Content.ReadAsStringAsync(); 177var body = await response.Content.ReadAsStringAsync(); 200var body = await response.Content.ReadAsStringAsync(); 223var body = await response.Content.ReadAsStringAsync(); 245var body = await response.Content.ReadAsStringAsync(); 274var body = await response.Content.ReadAsStringAsync(); 310var body = await response.Content.ReadAsStringAsync(); 345var body = await response.Content.ReadAsStringAsync(); 369var body = await response.Content.ReadAsStringAsync(); 387var body = await response.Content.ReadAsStringAsync(); 401var body = await response.Content.ReadAsStringAsync(); 422var body = await response.Content.ReadAsStringAsync(); 445var body = await response.Content.ReadAsStringAsync(); 464var body = await response.Content.ReadAsStringAsync(); 484var body = await response.Content.ReadAsStringAsync(); 508var body = await response.Content.ReadAsStringAsync(); 528var body = await response.Content.ReadAsStringAsync(); 551var body = await response.Content.ReadAsStringAsync(); 573var body = await response.Content.ReadAsStringAsync(); 594var body = await response.Content.ReadAsStringAsync(); 618var body = await response.Content.ReadAsStringAsync(); 650var body = await response.Content.ReadAsStringAsync(); 682var body = await response.Content.ReadAsStringAsync(); 714var body = await response.Content.ReadAsStringAsync(); 744var body = await response.Content.ReadAsStringAsync(); 781var body = await response.Content.ReadAsStringAsync(); 816var body = await response.Content.ReadAsStringAsync(); 846var body = await response.Content.ReadAsStringAsync(); 872var body = await response.Content.ReadAsStringAsync(); 896var body = await response.Content.ReadAsStringAsync(); 925var body = await response.Content.ReadAsStringAsync(); 951var body = await response.Content.ReadAsStringAsync(); 969var body = await response.Content.ReadAsStringAsync(); 994var body = await response.Content.ReadAsStringAsync(); 1018var body = await response.Content.ReadAsStringAsync(); 1042var body = await response.Content.ReadAsStringAsync(); 1066var body = await response.Content.ReadAsStringAsync(); 1110var body = await response.Content.ReadAsStringAsync(); 1142var body = await response.Content.ReadAsStringAsync(); 1329var responseBody = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); 1360var responseBody = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); 1395var responseBody = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); 1430var responseBody = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); 1470var responseBody = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); 1511var responseBody = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync(); 1540var responseBody = await response.EnsureSuccessStatusCode().Content.ReadAsStringAsync();
ApplicationModelTest.cs (10)
39var body = await response.Content.ReadAsStringAsync(); 52var body = await response.Content.ReadAsStringAsync(); 65var body = await response.Content.ReadAsStringAsync(); 78var body = await response.Content.ReadAsStringAsync(); 91var body = await response.Content.ReadAsStringAsync(); 104var body = await response.Content.ReadAsStringAsync(); 117var body = await response.Content.ReadAsStringAsync(); 135var body = await response.Content.ReadAsStringAsync(); 186var content = await response.Content.ReadAsStringAsync(); 204var body = await response.Content.ReadAsStringAsync();
AsyncActionsTests.cs (24)
35var responseBody = await response.Content.ReadAsStringAsync(); 47var responseBody = await response.Content.ReadAsStringAsync(); 59var responseBody = await response.Content.ReadAsStringAsync(); 70var responseBody = await response.Content.ReadAsStringAsync(); 82var responseBody = await response.Content.ReadAsStringAsync(); 93var responseBody = await response.Content.ReadAsStringAsync(); 105var responseBody = await response.Content.ReadAsStringAsync(); 116var responseBody = await response.Content.ReadAsStringAsync(); 128var responseBody = await response.Content.ReadAsStringAsync(); 139var responseBody = await response.Content.ReadAsStringAsync(); 151var responseBody = await response.Content.ReadAsStringAsync(); 162var responseBody = await response.Content.ReadAsStringAsync(); 174var responseBody = await response.Content.ReadAsStringAsync(); 185var responseBody = await response.Content.ReadAsStringAsync(); 197var responseBody = await response.Content.ReadAsStringAsync(); 208var responseBody = await response.Content.ReadAsStringAsync(); 220var responseBody = await response.Content.ReadAsStringAsync(); 231var responseBody = await response.Content.ReadAsStringAsync(); 243var responseBody = await response.Content.ReadAsStringAsync(); 254var responseBody = await response.Content.ReadAsStringAsync(); 266var responseBody = await response.Content.ReadAsStringAsync(); 277var responseBody = await response.Content.ReadAsStringAsync(); 289var responseBody = await response.Content.ReadAsStringAsync(); 323var content = await response.Content.ReadAsStringAsync();
AsyncEnumerableTestBase.cs (3)
47var content = await response.Content.ReadAsStringAsync(); 65var content = await response.Content.ReadAsStringAsync(); 84var content = await response.Content.ReadAsStringAsync();
AuthMiddlewareAndFilterTestBase.cs (1)
289return await response.Content.ReadAsStringAsync();
BasicTests.cs (33)
52var responseContent = await response.Content.ReadAsStringAsync(); 56Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 72var responseContent = await response.Content.ReadAsStringAsync(); 76Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 96var responseContent = await response.Content.ReadAsStringAsync(); 100Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 116var responseContent = await response.Content.ReadAsStringAsync(); 120Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 135var responseContent = await response.Content.ReadAsStringAsync(); 148var responseContent = await response.Content.ReadAsStringAsync(); 152Assert.Null(response.Content.Headers.ContentType); 153Assert.Equal(0, response.Content.Headers.ContentLength); 166Assert.Empty(await response.Content.ReadAsStringAsync()); 180var responseContent = await result.Content.ReadAsStringAsync(); 196Assert.Equal(0, response.Content.Headers.ContentLength); 198var responseBytes = await response.Content.ReadAsByteArrayAsync(); 212Assert.Equal(0, response.Content.Headers.ContentLength); 214var responseBytes = await response.Content.ReadAsByteArrayAsync(); 246Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 248var actualBody = await response.Content.ReadAsStringAsync(); 269Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 271var actualBody = await response.Content.ReadAsStringAsync(); 292Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 294var actualBody = await response.Content.ReadAsStringAsync(); 342var responseData = await response.Content.ReadAsStringAsync(); 354var responseData = await response.Content.ReadAsStringAsync(); 540var content = await response.Content.ReadAsStringAsync(); 563var content = await response.Content.ReadAsStringAsync(); 585var content = await response.Content.ReadAsStringAsync(); 605var content = await response.Content.ReadAsStringAsync(); 617var content = await response.Content.ReadAsStringAsync(); 629var problem = await response.Content.ReadFromJsonAsync<ValidationProblemDetails>(); 655var content = await response.Content.ReadAsStringAsync();
ComponentRenderingFunctionalTests.cs (5)
43var content = await response.Content.ReadAsStringAsync(); 59var content = await response.Content.ReadAsStringAsync(); 90var content = await response.Content.ReadAsStringAsync(); 106var content = await response.Content.ReadAsStringAsync(); 168var content = await response.Content.ReadAsStringAsync();
ConsumesAttributeEndpointRoutingTests.cs (1)
20var body = await response.Content.ReadAsStringAsync();
ConsumesAttributeTests.cs (1)
20var body = await response.Content.ReadAsStringAsync();
ConsumesAttributeTestsBase.cs (7)
53var body = await response.Content.ReadAsStringAsync(); 70var body = await response.Content.ReadAsStringAsync(); 106var product = JsonConvert.DeserializeObject<Product>(await response.Content.ReadAsStringAsync()); 128var product = JsonConvert.DeserializeObject<Product>(await response.Content.ReadAsStringAsync()); 152var responseString = await response.Content.ReadAsStringAsync(); 172var product = JsonConvert.DeserializeObject<Product>(await response.Content.ReadAsStringAsync()); 195var product = JsonConvert.DeserializeObject<Product>(await response.Content.ReadAsStringAsync());
ContentNegotiationTest.cs (42)
49Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 50var body = await response.Content.ReadAsStringAsync(); 66Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 67var body = await response.Content.ReadAsStringAsync(); 82Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 83var body = await response.Content.ReadAsStringAsync(); 97Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 117Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 136Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 137var actual = await response.Content.ReadAsStringAsync(); 161Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 162var actual = await response.Content.ReadAsStringAsync(); 179Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 180var actual = await response.Content.ReadAsStringAsync(); 220Assert.NotNull(response.Content); 221var contentType = response.Content.Headers.ContentType; 225var actualResponseBody = await response.Content.ReadAsStringAsync(); 242Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 243var body = await response.Content.ReadAsStringAsync(); 260Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 261var body = await response.Content.ReadAsStringAsync(); 277Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 278var body = await response.Content.ReadAsStringAsync(); 294Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 295var body = await response.Content.ReadAsStringAsync(); 312Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 313var body = await response.Content.ReadAsStringAsync(); 328Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 329var body = await response.Content.ReadAsStringAsync(); 353Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 354var body = await response.Content.ReadAsStringAsync(); 375Assert.Equal("text/plain; charset=utf-8", response.Content.Headers.ContentType.ToString()); 376var actualBody = await response.Content.ReadAsStringAsync(); 393Assert.Equal("application/json; charset=utf-8", response.Content.Headers.ContentType.ToString()); 394var actualBody = await response.Content.ReadAsStringAsync(); 480var body = await response.Content.ReadAsStringAsync(); 496Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 497var body = await response.Content.ReadAsStringAsync(); 514Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 515var bodyStream = await response.Content.ReadAsStreamAsync(); 535Assert.Equal("application/xml; charset=utf-8", response.Content.Headers.ContentType.ToString()); 536var body = await response.Content.ReadAsStringAsync();
ControllerEndpointFiltersTest.cs (4)
42var content = await response.Content.ReadFromJsonAsync<Dictionary<string, object>>(); 55var content = await response.Content.ReadFromJsonAsync<Dictionary<string, object>>(); 68var content = await response.Content.ReadAsStringAsync(); 80var content = await response.Content.ReadFromJsonAsync<Dictionary<string, object>>();
ControllerFromServicesTests.cs (3)
40var responseText = await response.Content.ReadAsStringAsync(); 85Assert.Equal(expected, await response.Content.ReadAsStringAsync()); 101Assert.Equal(expected, await response.Content.ReadAsStringAsync());
CorsTestsBase.cs (13)
52var content = await response.Content.ReadAsStringAsync(); 71var content = await response.Content.ReadAsStringAsync(); 89var content = await response.Content.ReadAsStringAsync(); 146var content = await response.Content.ReadAsStringAsync(); 178var content = await response.Content.ReadAsStringAsync(); 214var content = await response.Content.ReadAsStringAsync(); 236var content = await response.Content.ReadAsStringAsync(); 260var content = await response.Content.ReadAsStringAsync(); 289var content = await response.Content.ReadAsStringAsync(); 321var content = await response.Content.ReadAsStringAsync(); 356var content = await response.Content.ReadAsStringAsync(); 384var content = await response.Content.ReadAsStringAsync(); 407var content = await response.Content.ReadAsStringAsync();
CustomValueProviderTest.cs (8)
47var content = await response.Content.ReadAsStringAsync(); 51Assert.Equal("text/plain", response.Content.Headers.ContentType.MediaType); 64var content = await response.Content.ReadAsStringAsync(); 68Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 81var content = await response.Content.ReadAsStringAsync(); 85Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 98var content = await response.Content.ReadAsStringAsync(); 102Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType);
DataAnnotationTests.cs (1)
44var content = await response.Content.ReadAsStringAsync();
DoNotRespectBrowserAcceptHeaderTests.cs (16)
51Assert.NotNull(response.Content); 52Assert.NotNull(response.Content.Headers.ContentType); 53Assert.Equal("application/json; charset=utf-8", response.Content.Headers.ContentType.ToString()); 54var responseData = await response.Content.ReadAsStringAsync(); 79Assert.NotNull(response.Content); 80Assert.NotNull(response.Content.Headers.ContentType); 81Assert.Equal("application/xml; charset=utf-8", response.Content.Headers.ContentType.ToString()); 82var responseData = await response.Content.ReadAsStringAsync(); 108Assert.NotNull(response.Content); 109Assert.NotNull(response.Content.Headers.ContentType); 112Assert.Equal("application/json; charset=utf-8", response.Content.Headers.ContentType.ToString()); 114var responseData = await response.Content.ReadAsStringAsync(); 139Assert.NotNull(response.Content); 140Assert.NotNull(response.Content.Headers.ContentType); 141Assert.Equal("application/xml; charset=utf-8", response.Content.Headers.ContentType.ToString()); 142var responseData = await response.Content.ReadAsStringAsync();
ErrorPageTests.cs (11)
67Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 68var content = await response.Content.ReadAsStringAsync(); 102Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 103var content = await response.Content.ReadAsStringAsync(); 123Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 124var content = await response.Content.ReadAsStringAsync(); 143Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 144var content = await response.Content.ReadAsStringAsync(); 161Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 162var content = await response.Content.ReadAsStringAsync(); 177var content = await response.Content.ReadAsStringAsync();
FileResultTests.cs (139)
44Assert.NotNull(response.Content.Headers.ContentType); 45Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 47var body = await response.Content.ReadAsStringAsync(); 67Assert.NotNull(response.Content.Headers.ContentType); 68Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 69var body = await response.Content.ReadAsStringAsync(); 89Assert.NotNull(response.Content.Headers.ContentType); 90Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 91var body = await response.Content.ReadAsStringAsync(); 109Assert.NotNull(response.Content.Headers.ContentType); 110Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 111Assert.Equal(0, response.Content.Headers.ContentLength); 112var body = await response.Content.ReadAsStringAsync(); 131Assert.NotNull(response.Content.Headers.ContentType); 132Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 133var body = await response.Content.ReadAsStringAsync(); 153Assert.NotNull(response.Content.Headers.ContentType); 154Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 155var body = await response.Content.ReadAsStringAsync(); 173Assert.NotNull(response.Content.Headers.ContentType); 174Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 175Assert.Equal(0, response.Content.Headers.ContentLength); 176var body = await response.Content.ReadAsStringAsync(); 191Assert.NotNull(response.Content.Headers.ContentType); 192Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 194var body = await response.Content.ReadAsStringAsync(); 198var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 217Assert.NotNull(response.Content.Headers.ContentType); 218Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 219var body = await response.Content.ReadAsStringAsync(); 236Assert.NotNull(response.Content.Headers.ContentType); 237Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 238var body = await response.Content.ReadAsStringAsync(); 256Assert.NotNull(response.Content.Headers.ContentType); 257Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 258var body = await response.Content.ReadAsStringAsync(); 289Assert.NotNull(response.Content.Headers.ContentType); 290Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 292var body = await response.Content.ReadAsStringAsync(); 296var contentLength = response.Content.Headers.ContentLength; 299var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 314Assert.NotNull(response.Content.Headers.ContentType); 315Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 317var body = await response.Content.ReadAsStringAsync(); 331Assert.NotNull(response.Content.Headers.ContentType); 332Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 334var body = await response.Content.ReadAsStringAsync(); 353Assert.NotNull(response.Content.Headers.ContentType); 354Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 355var body = await response.Content.ReadAsStringAsync(); 376Assert.NotNull(response.Content.Headers.ContentType); 377Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 378var body = await response.Content.ReadAsStringAsync(); 393var body = await response.Content.ReadAsStringAsync(); 397Assert.NotNull(response.Content.Headers.ContentType); 398Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 399Assert.Equal(0, response.Content.Headers.ContentLength); 412Assert.NotNull(response.Content.Headers.ContentType); 413Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 415var body = await response.Content.ReadAsStringAsync(); 419var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 438Assert.NotNull(response.Content.Headers.ContentType); 439Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 440var body = await response.Content.ReadAsStringAsync(); 454var body = await response.Content.ReadAsStringAsync(); 457Assert.NotNull(response.Content.Headers.ContentType); 458Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 476var body = await response.Content.ReadAsStringAsync(); 508Assert.NotNull(response.Content.Headers.ContentType); 509Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 511var body = await response.Content.ReadAsStringAsync(); 515var contentLength = response.Content.Headers.ContentLength; 518var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 532Assert.NotNull(response.Content.Headers.ContentType); 533Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 535var body = await response.Content.ReadAsStringAsync(); 552var body = await response.Content.ReadAsStringAsync(); 555Assert.NotNull(response.Content.Headers.ContentType); 556Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 577Assert.NotNull(response.Content.Headers.ContentType); 578Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 579var body = await response.Content.ReadAsStringAsync(); 594var body = await response.Content.ReadAsStringAsync(); 597Assert.NotNull(response.Content.Headers.ContentType); 598Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 601Assert.NotNull(response.Content.Headers.ContentType); 602Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 603Assert.Equal(0, response.Content.Headers.ContentLength); 616Assert.NotNull(response.Content.Headers.ContentType); 617Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 619var body = await response.Content.ReadAsStringAsync(); 623var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 642Assert.NotNull(response.Content.Headers.ContentType); 643Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 644var body = await response.Content.ReadAsStringAsync(); 658var body = await response.Content.ReadAsStringAsync(); 661Assert.NotNull(response.Content.Headers.ContentType); 662Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 681Assert.NotNull(response.Content.Headers.ContentType); 682Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 683var body = await response.Content.ReadAsStringAsync(); 714Assert.NotNull(response.Content.Headers.ContentType); 715Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 717var body = await response.Content.ReadAsStringAsync(); 721var contentLength = response.Content.Headers.ContentLength; 724var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 741Assert.NotNull(response.Content.Headers.ContentType); 742Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 744var body = await response.Content.ReadAsStringAsync(); 748var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 768Assert.NotNull(response.Content.Headers.ContentType); 769Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 770var body = await response.Content.ReadAsStringAsync(); 773var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 792Assert.NotNull(response.Content.Headers.ContentType); 793Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 794var body = await response.Content.ReadAsStringAsync(); 811Assert.NotNull(response.Content.Headers.ContentType); 812Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 813var body = await response.Content.ReadAsStringAsync(); 816var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 834Assert.NotNull(response.Content.Headers.ContentType); 835Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 836var body = await response.Content.ReadAsStringAsync(); 838var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 858Assert.NotNull(response.Content.Headers.ContentType); 859Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 860var body = await response.Content.ReadAsStringAsync(); 862var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 881Assert.NotNull(response.Content.Headers.ContentType); 882Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 883Assert.Equal(0, response.Content.Headers.ContentLength); 884var body = await response.Content.ReadAsStringAsync(); 886var contentDisposition = response.Content.Headers.ContentDisposition.ToString(); 918Assert.NotNull(response.Content.Headers.ContentType); 919Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 921var body = await response.Content.ReadAsStringAsync(); 925var contentLength = response.Content.Headers.ContentLength; 928var contentDisposition = response.Content.Headers.ContentDisposition.ToString();
FiltersTest.cs (5)
40Assert.Equal("Hello World!", await response.Content.ReadAsStringAsync()); 51Assert.Equal("Hello World!", await response.Content.ReadAsStringAsync()); 79await response.Content.ReadAsStringAsync()); 97Assert.Equal("Can't process this!", await response.Content.ReadAsStringAsync()); 124Assert.Equal("Service filter content", await response.Content.ReadAsStringAsync());
FormFileUploadTest.cs (2)
47var user = await response.Content.ReadAsAsync<User>(); 75var product = await response.Content.ReadAsAsync<Product>();
GlobalAuthorizationFilterTestBase.cs (1)
56var body = await response.Content.ReadAsStringAsync();
HtmlGenerationTest.cs (17)
110var responseContent = await response.Content.ReadAsStringAsync(); 114Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 139Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 227var responseContent = await response.Content.ReadAsStringAsync(); 231Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 267var responseContent = await response.Content.ReadAsStringAsync(); 271Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 306var responseContent = await response.Content.ReadAsStringAsync(); 310Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 337var responseContent = await response.Content.ReadAsStringAsync(); 431var response1 = await (await Client.SendAsync(request)).Content.ReadAsStringAsync(); 433var response2 = await (await Client.SendAsync(request)).Content.ReadAsStringAsync(); 447var response3 = await (await Client.SendAsync(request)).Content.ReadAsStringAsync(); 449var response4 = await (await Client.SendAsync(request)).Content.ReadAsStringAsync(); 462var response5 = await (await Client.SendAsync(request)).Content.ReadAsStringAsync(); 464var response6 = await (await Client.SendAsync(request)).Content.ReadAsStringAsync(); 506var response2 = await (await Client.SendAsync(request)).Content.ReadAsStringAsync();
HttpActionResultTests.cs (1)
42var result = await response.Content.ReadFromJsonAsync<Contact>();
Infrastructure\HttpClientExtensions.cs (2)
24var content = await response.Content.ReadAsStringAsync(); 45responseContent = await response.Content.ReadAsStringAsync();
InputFormatterTests.cs (10)
52Assert.Equal(sampleInputInt.ToString(CultureInfo.InvariantCulture), await response.Content.ReadAsStringAsync()); 65var responseBody = await response.Content.ReadAsStringAsync(); 95var result = JsonConvert.DeserializeObject<DerivedModel>(await response.Content.ReadAsStringAsync()); 107var result = JObject.Parse(await response.Content.ReadAsStringAsync()); 127var result = JsonConvert.DeserializeObject<DerivedModel>(await response.Content.ReadAsStringAsync()); 139var result = JObject.Parse(await response.Content.ReadAsStringAsync()); 159var result = JsonConvert.DeserializeObject<DerivedModel>(await response.Content.ReadAsStringAsync()); 171var result = JObject.Parse(await response.Content.ReadAsStringAsync()); 190var problemDetails = await response.Content.ReadFromJsonAsync<ValidationProblemDetails>(); 208var problemDetails = await response.Content.ReadFromJsonAsync<ValidationProblemDetails>();
InputObjectValidationTests.cs (13)
83await response.Content.ReadAsStringAsync()); 111await response.Content.ReadAsStringAsync()); 126await response.Content.ReadAsStringAsync()); 146var responseContent = await response.Content.ReadAsStringAsync(); 174var responseContent = await response.Content.ReadAsStringAsync(); 196Assert.Equal("xyz", await response.Content.ReadAsStringAsync()); 216var responseContent = await response.Content.ReadAsStringAsync(); 236var responseContent = await response.Content.ReadAsStringAsync(); 257var responseContent = await response.Content.ReadAsStringAsync(); 278var content = await response.Content.ReadAsStringAsync(); 299var responseContent = await response.Content.ReadAsStringAsync(); 328var responseContent = await response.Content.ReadAsStringAsync(); 360var responseContent = await response.Content.ReadAsStringAsync();
InputParentValidationTests.cs (2)
56var responseContent = await response.Content.ReadAsStringAsync(); 75var responseContent = await response.Content.ReadAsStringAsync();
InputValidationTests.cs (2)
51var responseText = await response.Content.ReadAsStringAsync(); 86var responseText = await response.Content.ReadAsStringAsync();
JsonInputFormatterTestBase.cs (9)
54Assert.Equal(sampleInputInt.ToString(CultureInfo.InvariantCulture), await response.Content.ReadAsStringAsync()); 70var responseBody = await response.Content.ReadAsStringAsync(); 88var responseBody = await response.Content.ReadAsStringAsync(); 104var responseBody = await response.Content.ReadAsStringAsync(); 124var actual = await response.Content.ReadAsAsync<JsonFormatterController.SimpleModel>(); 141var actual = await response.Content.ReadAsAsync<JsonFormatterController.SimpleRecordModel>(); 161var problem = await response.Content.ReadFromJsonAsync<ValidationProblemDetails>(); 192var actual = await response.Content.ReadFromJsonAsync<JsonFormatterController.SimpleModel>(); 229var responseBody = await response.Content.ReadAsStringAsync();
JsonOutputFormatterTestBase.cs (11)
61var actualContent = await response.Content.ReadAsStringAsync(); 85Assert.Equal("2", await response.Content.ReadAsStringAsync()); 96Assert.Equal("\"Hello world\"", await response.Content.ReadAsStringAsync()); 107Assert.Equal("\"Hello Mr. 🦊\"", await response.Content.ReadAsStringAsync()); 118Assert.Equal("\"Une bête de cirque\"", await response.Content.ReadAsStringAsync()); 132Assert.Equal(expected, await response.Content.ReadAsStringAsync()); 146Assert.Equal(expected, await response.Content.ReadAsStringAsync()); 160Assert.Equal(expected, await response.Content.ReadAsStringAsync()); 175Assert.Equal(expected, await response.Content.ReadAsStringAsync()); 189var obj = JObject.Parse(await response.Content.ReadAsStringAsync()); 207Assert.Equal(expected, await response.Content.ReadAsStringAsync());
JsonPatchInputFormatterTest.cs (5)
45var body = await response.Content.ReadAsStringAsync(); 65var body = await response.Content.ReadAsStringAsync(); 85var body = await response.Content.ReadAsStringAsync(); 106var body = await response.Content.ReadAsStringAsync(); 127var body = await response.Content.ReadAsStringAsync();
JsonResultWithNewtonsoftJsonTest.cs (11)
47var content = await response.Content.ReadAsStringAsync(); 51Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 69var content = await response.Content.ReadAsStringAsync(); 73Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 87var content = await response.Content.ReadAsStringAsync(); 91Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 105var content = await response.Content.ReadAsStringAsync(); 109Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 122var content = await response.Content.ReadAsStringAsync(); 138var content = await response.Content.ReadAsStringAsync(); 142Assert.Equal("application/message+json", response.Content.Headers.ContentType.MediaType);
JsonResultWithSystemTextJsonTest.cs (11)
47var content = await response.Content.ReadAsStringAsync(); 51Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 69var content = await response.Content.ReadAsStringAsync(); 73Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 87var content = await response.Content.ReadAsStringAsync(); 91Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 105var content = await response.Content.ReadAsStringAsync(); 109Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 122var content = await response.Content.ReadAsStringAsync(); 138var content = await response.Content.ReadAsStringAsync(); 142Assert.Equal("application/message+json", response.Content.Headers.ContentType.MediaType);
KeyedServicesTests.cs (5)
43Assert.Equal("OK", await okResponse.Content.ReadAsStringAsync()); 44Assert.Equal("NOT OK", await notokResponse.Content.ReadAsStringAsync()); 58Assert.Equal("OK,NOT OK", await response.Content.ReadAsStringAsync()); 72Assert.Equal("DEFAULT", await response.Content.ReadAsStringAsync()); 86Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync());
LinkGenerationTests.cs (3)
62var responseContent = await response.Content.ReadAsStringAsync(); 84var responseContent = await response.Content.ReadAsStringAsync(); 88Assert.Equal(expectedMediaType, response.Content.Headers.ContentType);
LinkGeneratorTest.cs (18)
42var responseContent = await response.Content.ReadAsStringAsync(); 54var responseContent = await response.Content.ReadAsStringAsync(); 66var responseContent = await response.Content.ReadAsStringAsync(); 78var responseContent = await response.Content.ReadAsStringAsync(); 90var responseContent = await response.Content.ReadAsStringAsync(); 102var responseContent = await response.Content.ReadAsStringAsync(); 116var responseContent = await response.Content.ReadAsStringAsync(); 128var responseContent = await response.Content.ReadAsStringAsync(); 140var responseContent = await response.Content.ReadAsStringAsync(); 152var responseContent = await response.Content.ReadAsStringAsync(); 164var responseContent = await response.Content.ReadAsStringAsync(); 176var responseContent = await response.Content.ReadAsStringAsync(); 188var responseContent = await response.Content.ReadAsStringAsync(); 200var responseContent = await response.Content.ReadAsStringAsync(); 212var responseContent = await response.Content.ReadAsStringAsync(); 224var responseContent = await response.Content.ReadAsStringAsync(); 236var responseContent = await response.Content.ReadAsStringAsync(); 248var responseContent = await response.Content.ReadAsStringAsync();
LinkParserTest.cs (2)
42var values = await response.Content.ReadAsAsync<JObject>(); 72var values = await response.Content.ReadAsAsync<JObject>();
NewtonsoftJsonInputFormatterTest.cs (1)
20var responseBody = await response.Content.ReadAsStringAsync();
NewtonsoftJsonOutputFormatterTest.cs (2)
35var actualBody = await response.Content.ReadAsStringAsync(); 47Assert.Equal(50, response.Content.Headers.ContentLength);
NonNullableReferenceTypesTest.cs (4)
42var content = await response.Content.ReadAsStringAsync(); 66content = await response.Content.ReadAsStringAsync(); 84var content = await response.Content.ReadAsStringAsync(); 120var content = await response.Content.ReadAsStringAsync();
OutputFormatterTest.cs (11)
46Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 47var body = await response.Content.ReadAsStringAsync(); 63Assert.Equal(expectedContentType, response.Content.Headers.ContentType); 75Assert.Null(response.Content.Headers.ContentType); 76var body = await response.Content.ReadAsStringAsync(); 80Assert.Equal(0, response.Content.Headers.ContentLength); 93Assert.Null(response.Content.Headers.ContentType); 94var body = await response.Content.ReadAsStringAsync(); 98Assert.Equal(0, response.Content.Headers.ContentLength); 113Assert.Null(response.Content.Headers.ContentType); 114var body = await response.Content.ReadAsStringAsync();
RazorBuildTest.cs (4)
57var responseBody = await response.Content.ReadAsStringAsync(); 73var responseBody = await response.Content.ReadAsStringAsync(); 82var responseBody = await response.Content.ReadAsStringAsync(); 95var responseBody = await response.Content.ReadAsStringAsync();
RazorPageModelTest.cs (7)
55var content = await response.Content.ReadAsStringAsync(); 80var content = await response.Content.ReadAsStringAsync(); 105var content = await response.Content.ReadAsStringAsync(); 131var content = await response.Content.ReadAsStringAsync(); 156var content = await response.Content.ReadAsStringAsync(); 181var content = await response.Content.ReadAsStringAsync(); 191var getResponseBody = await getResponse.Content.ReadAsStringAsync();
RazorPagesTest.cs (52)
52var responseContent = await response.Content.ReadAsStringAsync(); 56Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 97var getResponseBody = await getResponse.Content.ReadAsStringAsync(); 110var content = await response.Content.ReadAsStringAsync(); 129var getResponseBody = await getResponse.Content.ReadAsStringAsync(); 141var content = await response.Content.ReadAsStringAsync(); 210var getResponseBody = await getResponse.Content.ReadAsStringAsync(); 223var content = await response.Content.ReadAsStringAsync(); 242var getResponseBody = await getResponse.Content.ReadAsStringAsync(); 254var content = await response.Content.ReadAsStringAsync(); 293var content = await routeResponse.Content.ReadAsStringAsync(); 307var content = await response.Content.ReadAsStringAsync(); 323var content = await response.Content.ReadAsStringAsync(); 353Assert.Equal("Parameter cannot be null.", await response.Content.ReadAsStringAsync()); 370var content = await response.Content.ReadAsStringAsync(); 386var content = await response.Content.ReadAsStringAsync(); 402var content = await response.Content.ReadAsStringAsync(); 412var getResponseBody = await getResponse.Content.ReadAsStringAsync(); 426var content = await response.Content.ReadAsStringAsync(); 445var content = await response.Content.ReadAsStringAsync(); 474var content = await response.Content.ReadAsStringAsync(); 490var content = await response.Content.ReadAsStringAsync(); 515var content = await response.Content.ReadAsStringAsync(); 540var content = await response.Content.ReadAsStringAsync(); 564var content = await response.Content.ReadAsStringAsync(); 575var getResponseBody = await getResponse.Content.ReadAsStringAsync(); 589var content = await response.Content.ReadAsStringAsync(); 602content = await response.Content.ReadAsStringAsync(); 633var content = await response.Content.ReadAsStringAsync(); 686var content = await response.Content.ReadAsStringAsync(); 714var content = await response.Content.ReadAsStringAsync(); 741var content = await response.Content.ReadAsStringAsync(); 772var content = await response.Content.ReadAsStringAsync(); 801var content = await response.Content.ReadAsStringAsync(); 826var result = JObject.Parse(await response.Content.ReadAsStringAsync()); 857var content = await response.Content.ReadAsStringAsync(); 881var content = await response.Content.ReadAsStringAsync(); 897Assert.NotNull(response.Content); 898Assert.NotNull(response.Content.Headers.ContentType); 899Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 913Assert.NotNull(response.Content); 914Assert.NotNull(response.Content.Headers.ContentType); 915Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 930var content = await response.Content.ReadAsStringAsync(); 1255Assert.Equal(expected, (await response.Content.ReadAsStringAsync()).Trim()); 1302var responseContent = await response.Content.ReadAsStringAsync(); 1317var content = await response.Content.ReadAsStringAsync(); 1343var responseContent = await response.Content.ReadAsStringAsync(); 1463var content = await response.Content.ReadAsStringAsync(); 1479var content = await response.Content.ReadAsStringAsync(); 1495var content = await response.Content.ReadAsStringAsync(); 1503var getResponseBody = await getResponse.Content.ReadAsStringAsync();
RazorPagesWithBasePathTest.cs (12)
50var content = await response.Content.ReadAsStringAsync(); 63var content = await response.Content.ReadAsStringAsync(); 76var content = await response.Content.ReadAsStringAsync(); 89var content = await response.Content.ReadAsStringAsync(); 102var content = await response.Content.ReadAsStringAsync(); 420var content = await response.Content.ReadAsStringAsync(); 429var token = AntiforgeryTestHelper.RetrieveAntiforgeryToken(await getPage.Content.ReadAsStringAsync(), ""); 449var content = await response.Content.ReadAsStringAsync(); 458var token = AntiforgeryTestHelper.RetrieveAntiforgeryToken(await getPage.Content.ReadAsStringAsync(), ""); 486var token = AntiforgeryTestHelper.RetrieveAntiforgeryToken(await getPage.Content.ReadAsStringAsync(), ""); 506var responseText = await response.Content.ReadAsStringAsync(); 758var responseBody = await response.Content.ReadAsStringAsync();
RazorPagesWithEndpointRoutingTest.cs (1)
50var content = await response.Content.ReadAsStringAsync();
RazorViewLocationSpecificationTest.cs (1)
115var content = await (await Client.GetAsync(path)).Content.ReadAsStringAsync();
ReadFromDisconnectedClientTest.cs (1)
66var problem = await response.Content.ReadFromJsonAsync<ValidationProblemDetails>();
RemoteAttributeValidationTest.cs (9)
49Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 50Assert.Equal("utf-8", response.Content.Headers.ContentType.CharSet); 52var responseContent = await response.Content.ReadAsStringAsync(); 74Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 75Assert.Equal("utf-8", response.Content.Headers.ContentType.CharSet); 76var responseContent = await response.Content.ReadAsStringAsync(); 103Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 104Assert.Equal("utf-8", response.Content.Headers.ContentType.CharSet); 105var responseContent = await response.Content.ReadAsStringAsync();
RequestFormLimitsTest.cs (3)
75var result = await response.Content.ReadAsStringAsync(); 101var result = await response.Content.ReadAsStringAsync(); 124var result = await response.Content.ReadAsStringAsync();
RequestServicesEndpointRoutingTest.cs (1)
20var body = await response.Content.ReadAsStringAsync();
RequestServicesTest.cs (1)
20var body = await response.Content.ReadAsStringAsync();
RequestServicesTestBase.cs (3)
61var body = (await response.Content.ReadAsStringAsync()).Trim(); 81var body = (await response.Content.ReadAsStringAsync()).Trim(); 101var body1 = (await response1.Content.ReadAsStringAsync()).Trim();
RequestSizeLimitTest.cs (2)
52var result = await response.Content.ReadAsStringAsync(); 91var actual = await response.Content.ReadAsStringAsync();
RespectBrowserAcceptHeaderTests.cs (8)
51Assert.NotNull(response.Content); 52Assert.NotNull(response.Content.Headers.ContentType); 53Assert.Equal("application/json; charset=utf-8", response.Content.Headers.ContentType.ToString()); 54var responseData = await response.Content.ReadAsStringAsync(); 70Assert.NotNull(response.Content); 71Assert.NotNull(response.Content.Headers.ContentType); 72Assert.Equal("text/plain; charset=utf-8", response.Content.Headers.ContentType.ToString()); 73var responseData = await response.Content.ReadAsStringAsync();
RoutingAcrossPipelineBranchesTest.cs (9)
48var subdirContent = await subdirResponse.Content.ReadFromJsonAsync<RouteInfo>(); 51var commonContent = await commonResponse.Content.ReadFromJsonAsync<RouteInfo>(); 54var defaultContent = await defaultResponse.Content.ReadFromJsonAsync<RouteInfo>(); 83var subdirContent = await subdirResponse.Content.ReadFromJsonAsync<RouteInfo>(); 86var commonContent = await commonResponse.Content.ReadFromJsonAsync<RouteInfo>(); 89var defaultContent = await defaultResponse.Content.ReadFromJsonAsync<RouteInfo>(); 116var subdirContent = await subdirResponse.Content.ReadFromJsonAsync<RouteInfo>(); 119var defaultContent = await defaultResponse.Content.ReadFromJsonAsync<RouteInfo>(); 167var content = await response.Content.ReadFromJsonAsync<RouteInfo>();
RoutingDynamicOrderTest.cs (6)
48var content = await response.Content.ReadFromJsonAsync<RouteInfo>(); 70var content = await response.Content.ReadFromJsonAsync<RouteInfo>(); 93var content = await response.Content.ReadFromJsonAsync<RouteInfo>(); 115var content = await response.Content.ReadFromJsonAsync<RouteInfo>(); 137var content = await response.Content.ReadAsStringAsync(); 159var content = await response.Content.ReadFromJsonAsync<RouteInfo>();
RoutingDynamicTest.cs (7)
44var content = await response.Content.ReadAsStringAsync(); 59var content = await response.Content.ReadAsStringAsync(); 74var content = await response.Content.ReadAsStringAsync(); 104var content = await response.Content.ReadAsStringAsync(); 120var content = await response.Content.ReadAsStringAsync(); 136var content = await response.Content.ReadAsStringAsync(); 172var content = await response.Content.ReadAsStringAsync();
RoutingEndpointRoutingTest.cs (22)
21var body = await response.Content.ReadAsStringAsync(); 42var body = await response.Content.ReadAsStringAsync(); 68var body = await response.Content.ReadAsStringAsync(); 84var body = await response.Content.ReadAsStringAsync(); 100var body = await response.Content.ReadAsStringAsync(); 128var body = await response.Content.ReadAsStringAsync(); 148var body = await response.Content.ReadAsStringAsync(); 168var body = await response.Content.ReadAsStringAsync(); 188var body = await response.Content.ReadAsStringAsync(); 206var body = await response.Content.ReadAsStringAsync(); 221var body = await response.Content.ReadAsStringAsync(); 238var body = await response.Content.ReadAsStringAsync(); 265var body = await response.Content.ReadAsStringAsync(); 290var body = await response.Content.ReadAsStringAsync(); 305var body = await response.Content.ReadAsStringAsync(); 325var body = await response.Content.ReadAsStringAsync(); 344var body = await response.Content.ReadAsStringAsync(); 363var body = await response.Content.ReadAsStringAsync(); 381var body = await response.Content.ReadAsStringAsync(); 396var body = await response.Content.ReadAsStringAsync(); 411var body = await response.Content.ReadAsStringAsync(); 426var body = await response.Content.ReadAsStringAsync();
RoutingFallbackTest.cs (6)
45var content = await response.Content.ReadAsStringAsync(); 60var content = await response.Content.ReadAsStringAsync(); 76var content = await response.Content.ReadAsStringAsync(); 92var content = await response.Content.ReadAsStringAsync(); 108var content = await response.Content.ReadAsStringAsync(); 124var content = await response.Content.ReadAsStringAsync();
RoutingGroupsTest.cs (1)
43var content = await response.Content.ReadFromJsonAsync<RouteInfo>();
RoutingGroupsWithMetadataTest.cs (1)
44var content = await response.Content.ReadFromJsonAsync<string[]>();
RoutingTests.cs (3)
22var body = await response.Content.ReadAsStringAsync(); 51var body = await response.Content.ReadAsStringAsync(); 73var body = await response.Content.ReadAsStringAsync();
RoutingTestsBase.cs (63)
49var body = await response.Content.ReadAsStringAsync(); 67var body = await response.Content.ReadAsStringAsync(); 93var body = await response.Content.ReadAsStringAsync(); 115var body = await response.Content.ReadAsStringAsync(); 135var body = await response.Content.ReadAsStringAsync(); 164var body = await response.Content.ReadAsStringAsync(); 175body = await response.Content.ReadAsStringAsync(); 196var body = await response.Content.ReadAsStringAsync(); 208var body = await response.Content.ReadAsStringAsync(); 241var body = await response.Content.ReadAsStringAsync(); 253var body = await response.Content.ReadAsStringAsync(); 266var body = await response.Content.ReadAsStringAsync(); 290var body = await response.Content.ReadAsStringAsync(); 324var body = await response.Content.ReadAsStringAsync(); 361var body = await response.Content.ReadAsStringAsync(); 376var body = await response.Content.ReadAsStringAsync(); 409var body = await response.Content.ReadAsStringAsync(); 474var body = await response.Content.ReadAsStringAsync(); 501var body = await response.Content.ReadAsStringAsync(); 543var body = await response.Content.ReadAsStringAsync(); 571var body = await response.Content.ReadAsStringAsync(); 637var body = await response.Content.ReadAsStringAsync(); 654var body = await response.Content.ReadAsStringAsync(); 684var body = await response.Content.ReadAsStringAsync(); 711var body = await response.Content.ReadAsStringAsync(); 736var body = await response.Content.ReadAsStringAsync(); 756var body = await response.Content.ReadAsStringAsync(); 779var body = await response.Content.ReadAsStringAsync(); 801var body = await response.Content.ReadAsStringAsync(); 826var body = await response.Content.ReadAsStringAsync(); 846var body = await response.Content.ReadAsStringAsync(); 869var body = await response.Content.ReadAsStringAsync(); 890var body = await response.Content.ReadAsStringAsync(); 911var body = await response.Content.ReadAsStringAsync(); 932var body = await response.Content.ReadAsStringAsync(); 987var body = await response.Content.ReadAsStringAsync(); 1007var body = await response.Content.ReadAsStringAsync(); 1027var body = await response.Content.ReadAsStringAsync(); 1047var body = await response.Content.ReadAsStringAsync(); 1071var body = await response.Content.ReadAsStringAsync(); 1089var body = await response.Content.ReadAsStringAsync(); 1111var body = await response.Content.ReadAsStringAsync(); 1129var body = await response.Content.ReadAsStringAsync(); 1151var body = await response.Content.ReadAsStringAsync(); 1172var body = await response.Content.ReadAsStringAsync(); 1193var body = await response.Content.ReadAsStringAsync(); 1215var body = await response.Content.ReadAsStringAsync(); 1237var body = await response.Content.ReadAsStringAsync(); 1259var body = await response.Content.ReadAsStringAsync(); 1281var body = await response.Content.ReadAsStringAsync(); 1301var body = await response.Content.ReadAsStringAsync(); 1322var body = await response.Content.ReadAsStringAsync(); 1343var body = await response.Content.ReadAsStringAsync(); 1363var body = await response.Content.ReadAsStringAsync(); 1384var body = await response.Content.ReadAsStringAsync(); 1405var body = await response.Content.ReadAsStringAsync(); 1426var body = await response.Content.ReadAsStringAsync(); 1447var body = await response.Content.ReadAsStringAsync(); 1468var body = await response.Content.ReadAsStringAsync(); 1494var body = await response.Content.ReadAsStringAsync(); 1546var body = await response.Content.ReadAsStringAsync(); 1580var content = await response.Content.ReadAsStringAsync(); 1592var content = await response.Content.ReadAsStringAsync();
RoutingWithoutRazorPagesTestsBase.cs (2)
45var body = await response.Content.ReadAsStringAsync(); 66var body = await response.Content.ReadAsStringAsync();
SerializableErrorTests.cs (10)
59Assert.NotNull(response.Content); 60Assert.NotNull(response.Content.Headers.ContentType); 61Assert.Equal(acceptHeader, response.Content.Headers.ContentType.MediaType); 62var responseData = await response.Content.ReadAsStringAsync(); 83Assert.NotNull(response.Content); 84Assert.NotNull(response.Content.Headers.ContentType); 85Assert.Equal(acceptHeader, response.Content.Headers.ContentType.MediaType); 86var responseData = await response.Content.ReadAsStringAsync(); 129var responseData = await response.Content.ReadAsStringAsync(); 170var responseData = await response.Content.ReadAsStringAsync();
SimpleWithWebApplicationBuilderTests.cs (5)
63var content = await response.Content.ReadAsStringAsync(); 78var content = await response.Content.ReadAsStringAsync(); 94var content = await response.Content.ReadAsStringAsync(); 133var content = await response.Content.ReadAsStringAsync(); 277var actual = await response.Content.ReadAsStringAsync();
StreamOutputFormatterTest.cs (2)
39var body = await response.Content.ReadAsStringAsync(); 42Assert.Equal(contentType, response.Content.Headers.ContentType?.ToString());
SystemTextJsonOutputFormatterTest.cs (4)
24Assert.Equal("\"Hello Mr. \\uD83E\\uDD8A\"", await response.Content.ReadAsStringAsync()); 43Assert.Equal("\"Une b\\u00EAte de cirque\"", await response.Content.ReadAsStringAsync()); 66Assert.Equal(expected, await response.Content.ReadAsStringAsync()); 81Assert.Equal(expected, await response.Content.ReadAsStringAsync());
TagHelperComponentTagHelperTest.cs (3)
44var responseContent = await response.Content.ReadAsStringAsync(); 64var responseContent = await response.Content.ReadAsStringAsync(); 84var responseContent = await response.Content.ReadAsStringAsync();
TagHelpersFromServicesTest.cs (1)
38var responseText = await response.Content.ReadAsStringAsync();
TagHelpersTest.cs (10)
62Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 64var responseContent = await response.Content.ReadAsStringAsync(); 99Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 101var responseContent = await response.Content.ReadAsStringAsync(); 116var responseContent = await response.Content.ReadAsStringAsync(); 120Assert.Equal(expectedMediaType, response.Content.Headers.ContentType); 218var responseContent = await response.Content.ReadAsStringAsync(); 246var responseContent = await response.Content.ReadAsStringAsync(); 274var responseContent = await response.Content.ReadAsStringAsync(); 296var responseContent = await response.Content.ReadAsStringAsync();
TempDataInCookiesTest.cs (2)
93var body = await response.Content.ReadAsStringAsync(); 149var body = await response.Content.ReadAsStringAsync();
TempDataInCookiesUsingCookieConsentTest.cs (1)
59var body = await response.Content.ReadAsStringAsync();
TempDataPropertyTest.cs (6)
55var body = await response.Content.ReadAsStringAsync(); 83var body = await response.Content.ReadAsStringAsync(); 112var body = await response.Content.ReadAsStringAsync(); 120body = await response.Content.ReadAsStringAsync(); 149var body = await response.Content.ReadAsStringAsync(); 156body = await response.Content.ReadAsStringAsync();
TempDataTestBase.cs (9)
56var body = await response.Content.ReadAsStringAsync(); 81var body = await response.Content.ReadAsStringAsync(); 112var body = await response.Content.ReadAsStringAsync(); 137var body = await peekResponse.Content.ReadAsStringAsync(); 145body = await getResponse.Content.ReadAsStringAsync(); 177var body = await response.Content.ReadAsStringAsync(); 216var body = await response.Content.ReadAsStringAsync(); 234var responseBody = await response.Content.ReadAsStringAsync(); 252var responseBody = await response.Content.ReadAsStringAsync();
TestingInfrastructureTests.cs (6)
68var handlerResponse = await response.Content.ReadAsAsync<RedirectHandlerResponse>(); 91var handlerResponse = await response.Content.ReadAsAsync<RedirectHandlerResponse>(); 107var modifiedHeaderWasSent = await response.Content.ReadAsStringAsync(); 150Assert.Equal("Test", await response.Content.ReadAsStringAsync()); 166var handlerResponse = await response.Content.ReadAsAsync<PostRedirectGetGetResponse>(); 179Assert.Equal(5, await response.Content.ReadAsAsync<int>());
UrlResolutionTest.cs (2)
48var responseContent = await response.Content.ReadAsStringAsync(); 65var responseContent = await response.Content.ReadAsStringAsync();
VersioningEndpointRoutingTests.cs (3)
21var body = await response.Content.ReadAsStringAsync(); 40var body = await response.Content.ReadAsStringAsync(); 61var body = await response.Content.ReadAsStringAsync();
VersioningTests.cs (1)
20var body = await response.Content.ReadAsStringAsync();
VersioningTestsBase.cs (24)
53var body = await response.Content.ReadAsStringAsync(); 77var body = await response.Content.ReadAsStringAsync(); 97var body = await response.Content.ReadAsStringAsync(); 118var body = await response.Content.ReadAsStringAsync(); 137var body = await response.Content.ReadAsStringAsync(); 156var body = await response.Content.ReadAsStringAsync(); 183var body = await response.Content.ReadAsStringAsync(); 207var body = await response.Content.ReadAsByteArrayAsync(); 232var body = await response.Content.ReadAsStringAsync(); 258var body = await response.Content.ReadAsByteArrayAsync(); 277var body = await response.Content.ReadAsStringAsync(); 299var body = await response.Content.ReadAsStringAsync(); 320var body = await response.Content.ReadAsStringAsync(); 341var body = await response.Content.ReadAsStringAsync(); 363var body = await response.Content.ReadAsStringAsync(); 384var body = await response.Content.ReadAsStringAsync(); 403var body = await response.Content.ReadAsStringAsync(); 425var body = await response.Content.ReadAsStringAsync(); 446var body = await response.Content.ReadAsStringAsync(); 467var body = await response.Content.ReadAsStringAsync(); 491var body = await response.Content.ReadAsStringAsync(); 510var body = await response.Content.ReadAsStringAsync(); 529var body = await response.Content.ReadAsStringAsync(); 551var body = await response.Content.ReadAsStringAsync();
ViewComponentFromServicesTests.cs (1)
39var responseText = await response.Content.ReadAsStringAsync();
ViewEngineTests.cs (5)
82var body = await response.Content.ReadAsStringAsync(); 169var body = await response.Content.ReadAsStringAsync(); 259var body = await response.Content.ReadAsStringAsync(); 313var body = await response.Content.ReadAsStringAsync(); 431var body = await response.Content.ReadAsStringAsync();
XmlDataContractSerializerFormattersWrappingTest.cs (12)
52var result = await response.Content.ReadAsStringAsync(); 76var result = await response.Content.ReadAsStringAsync(); 100var result = await response.Content.ReadAsStringAsync(); 123var result = await response.Content.ReadAsStringAsync(); 146var result = await response.Content.ReadAsStringAsync(); 171var result = await response.Content.ReadAsStringAsync(); 194var result = await response.Content.ReadAsStringAsync(); 215var result = await response.Content.ReadAsStringAsync(); 236var content = await response.Content.ReadAsStringAsync(); 263var content = await response.Content.ReadAsStringAsync(); 278var content = await response.Content.ReadAsStringAsync(); 311var content = await response.Content.ReadAsStringAsync();
XmlDataContractSerializerInputFormatterTest.cs (3)
47var data = await response.Content.ReadAsStringAsync(); 67var responseStream = await response.Content.ReadAsStreamAsync(); 98var responseStream = await response.Content.ReadAsStreamAsync();
XmlOutputFormatterTests.cs (11)
54await response.Content.ReadAsStringAsync()); 55Assert.Equal(167, response.Content.Headers.ContentLength); 75await response.Content.ReadAsStringAsync()); 76Assert.Equal(149, response.Content.Headers.ContentLength); 99await response.Content.ReadAsStringAsync()); 120await response.Content.ReadAsStringAsync()); 143await response.Content.ReadAsStringAsync()); 181await response.Content.ReadAsStringAsync()); 201await response.Content.ReadAsStringAsync()); 222await response.Content.ReadAsStringAsync()); 243await response.Content.ReadAsStringAsync());
XmlSerializerFormattersWrappingTest.cs (12)
51var result = await response.Content.ReadAsStringAsync(); 72var result = await response.Content.ReadAsStringAsync(); 93var result = await response.Content.ReadAsStringAsync(); 113var result = await response.Content.ReadAsStringAsync(); 133var result = await response.Content.ReadAsStringAsync(); 155var result = await response.Content.ReadAsStringAsync(); 175var result = await response.Content.ReadAsStringAsync(); 193var result = await response.Content.ReadAsStringAsync(); 219var content = await response.Content.ReadAsStringAsync(); 246var content = await response.Content.ReadAsStringAsync(); 261var content = await response.Content.ReadAsStringAsync(); 293var content = await response.Content.ReadAsStringAsync();
XmlSerializerInputFormatterTests.cs (2)
48Assert.Equal(sampleInputInt.ToString(CultureInfo.InvariantCulture), await response.Content.ReadAsStringAsync()); 65var data = await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.OutputCaching.Tests (10)
OutputCacheTests.cs (10)
1004var len = resp.Content.Headers.ContentLength; 1005s = await resp.Content.ReadAsStringAsync(); 1042Assert.Equal(initialResponse.Content.Headers.ContentLocation, subsequentResponse.Content.Headers.ContentLocation); 1045Assert.Equal(initialResponse.Content.Headers.Expires, subsequentResponse.Content.Headers.Expires); 1059Assert.Equal(await initialResponse.Content.ReadAsStringAsync(), await subsequentResponse.Content.ReadAsStringAsync()); 1077Assert.NotEqual(await initialResponse.Content.ReadAsStringAsync(), await subsequentResponse.Content.ReadAsStringAsync());
Microsoft.AspNetCore.ResponseCaching.Tests (8)
ResponseCachingTests.cs (8)
946Assert.Equal(initialResponse.Content.Headers.ContentLocation, subsequentResponse.Content.Headers.ContentLocation); 949Assert.Equal(initialResponse.Content.Headers.Expires, subsequentResponse.Content.Headers.Expires); 963Assert.Equal(await initialResponse.Content.ReadAsStringAsync(), await subsequentResponse.Content.ReadAsStringAsync()); 981Assert.NotEqual(await initialResponse.Content.ReadAsStringAsync(), await subsequentResponse.Content.ReadAsStringAsync());
Microsoft.AspNetCore.ResponseCompression.Tests (32)
ResponseCompressionMiddlewareTest.cs (32)
424Assert.True(response.Content.Headers.ContentEncoding.Contains(otherContentEncoding)); 425Assert.False(response.Content.Headers.ContentEncoding.Contains("gzip")); 426Assert.Equal(50, response.Content.Headers.ContentLength); 479Assert.Equal(expectedLength, (await response.Content.ReadAsByteArrayAsync()).Length); 542Assert.Equal(expectedLength, (await response.Content.ReadAsByteArrayAsync()).Length); 605Assert.Equal(expectedLength, (await response.Content.ReadAsByteArrayAsync()).Length); 659await response.Content.LoadIntoBufferAsync(); 704await response.Content.LoadIntoBufferAsync(); 755Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 756Assert.Single(response.Content.Headers.ContentEncoding, encoding); 758var body = await response.Content.ReadAsStreamAsync(); 808Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 809Assert.Single(response.Content.Headers.ContentEncoding, encoding); 811var body = await response.Content.ReadAsStreamAsync(); 877Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 878Assert.Single(response.Content.Headers.ContentEncoding, encoding); 880var body = await response.Content.ReadAsStreamAsync(); 941Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 942Assert.Single(response.Content.Headers.ContentEncoding, encoding); 944var body = await response.Content.ReadAsStreamAsync(); 1005Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out var md5)); 1007Assert.Empty(response.Content.Headers.ContentEncoding); 1009var body = await response.Content.ReadAsStreamAsync(); 1217Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 1218Assert.Single(response.Content.Headers.ContentEncoding, encoding); 1220var body = await response.Content.ReadAsStreamAsync(); 1301Assert.False(response.Content.Headers.TryGetValues(HeaderNames.ContentMD5, out _)); 1302Assert.Single(response.Content.Headers.ContentEncoding, expectedEncoding); 1303Assert.Equal(expectedBodyLength, response.Content.Headers.ContentLength); 1325Assert.NotNull(response.Content.Headers.GetValues(HeaderNames.ContentMD5)); 1326Assert.Empty(response.Content.Headers.ContentEncoding); 1327Assert.Equal(expectedBodyLength, response.Content.Headers.ContentLength);
Microsoft.AspNetCore.Rewrite.Tests (1)
IISUrlRewrite\MiddleWareTests.cs (1)
693var content = await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.Routing.FunctionalTests (52)
Benchmarks\EndpointRoutingBenchmarkTest.cs (4)
50Assert.NotNull(response.Content); 51Assert.NotNull(response.Content.Headers.ContentType); 52Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType); 53var actualContent = await response.Content.ReadAsStringAsync();
Benchmarks\RouterBenchmarkTest.cs (4)
51Assert.NotNull(response.Content); 52Assert.NotNull(response.Content.Headers.ContentType); 53Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType); 54var actualContent = await response.Content.ReadAsStringAsync();
EndpointRoutingSampleTest.cs (25)
43Assert.Equal($"{branch} - API Get 5", await response.Content.ReadAsStringAsync()); 57Assert.NotNull(response.Content); 58Assert.NotNull(response.Content.Headers.ContentType); 59Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType); 74Assert.NotNull(response.Content); 75Assert.NotNull(response.Content.Headers.ContentType); 76Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType); 77var actualContent = await response.Content.ReadAsStringAsync(); 93Assert.NotNull(response.Content); 94Assert.NotNull(response.Content.Headers.ContentType); 95Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType); 96var actualContent = await response.Content.ReadAsStringAsync(); 111Assert.NotNull(response.Content); 112var actualContent = await response.Content.ReadAsStringAsync(); 137Assert.NotNull(response.Content); 138var actualContent = await response.Content.ReadAsStringAsync(); 153Assert.NotNull(response.Content); 154var actualContent = await response.Content.ReadAsStringAsync(); 180Assert.NotNull(response.Content); 181var actualContent = await response.Content.ReadAsStringAsync(); 198Assert.NotNull(response.Content); 199var actualContent = await response.Content.ReadAsStringAsync(); 211Assert.NotNull(response.Content); 212var actualContent = await response.Content.ReadAsStringAsync(); 225var actualContent = await response.Content.ReadAsStringAsync();
HostMatchingTests.cs (5)
37var responseContent = await response.Content.ReadAsStringAsync(); 55var responseContent = await response.Content.ReadAsStringAsync(); 73var responseContent = await response.Content.ReadAsStringAsync(); 91var responseContent = await response.Content.ReadAsStringAsync(); 109var responseContent = await response.Content.ReadAsStringAsync();
MapFallbackTest.cs (3)
29var responseContent = await response.Content.ReadAsStringAsync(); 63var responseContent = await response.Content.ReadAsStringAsync(); 97var responseContent = await response.Content.ReadAsStringAsync();
MinimalFormTests.cs (5)
66var body = await response.Content.ReadAsStringAsync(); 126var body = await response.Content.ReadAsStringAsync(); 287var body = await response.Content.ReadAsStringAsync(); 334var body = await response.Content.ReadAsStringAsync(); 494var body = await response.Content.ReadAsStringAsync();
RouteHandlerTest.cs (1)
55var echoedTodo = await response.Content.ReadFromJsonAsync<Todo>();
RouterSampleTest.cs (4)
41Assert.Equal($"{branch} - API Get 5", await response.Content.ReadAsStringAsync()); 55Assert.Equal($"API Get 5", await response.Content.ReadAsStringAsync()); 69Assert.Equal($"Middleware!", await response.Content.ReadAsStringAsync()); 92var body = await response.Content.ReadAsStringAsync();
WebHostBuilderExtensionsTest.cs (1)
101var actual = await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (113)
DelegateTests.cs (1)
280return await response.Content.ReadAsStringAsync();
Http3Tests.cs (5)
80Assert.Equal("HTTP/1.1", await response1.Content.ReadAsStringAsync()); 119Assert.Equal("HTTP/2", await response2.Content.ReadAsStringAsync()); 150var result = await response.Content.ReadAsStringAsync(); 209var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync()); 235var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync());
HttpsTests.cs (1)
285return await response.Content.ReadAsStringAsync();
Listener\RequestBodyTests.cs (1)
207return await response.Content.ReadAsStringAsync();
Listener\ResponseBodyTests.cs (10)
46Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 48Assert.Equal(new byte[10], await response.Content.ReadAsByteArrayAsync()); 70Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 72Assert.Equal(20, (await response.Content.ReadAsByteArrayAsync()).Length); 95Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 97Assert.Equal(new byte[0], await response.Content.ReadAsByteArrayAsync()); 118Assert.Equal(new byte[20], await response.Content.ReadAsByteArrayAsync()); 140Assert.Equal(new byte[20], await response.Content.ReadAsByteArrayAsync()); 204await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.LoadIntoBufferAsync()); 226await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.LoadIntoBufferAsync());
Listener\ResponseHeaderTests.cs (14)
44Assert.Single(response.Content.Headers); 45Assert.Equal(0, response.Content.Headers.ContentLength); 67Assert.Single(response.Content.Headers); 68Assert.Equal(0, response.Content.Headers.ContentLength); 89Assert.False(response.Content.Headers.Contains("Content-Length")); 90Assert.Empty(response.Content.Headers); 118Assert.False(response.Content.Headers.Contains("Content-Length")); 119Assert.Empty(response.Content.Headers); 147Assert.Single(response.Content.Headers); 148Assert.Equal(20, response.Content.Headers.ContentLength); 176Assert.False(response.Content.Headers.Contains("Content-Length")); 177Assert.Empty(response.Content.Headers); 199Assert.False(response.Content.Headers.Contains("Content-Length")); 200Assert.Empty(response.Content.Headers);
Listener\ServerOnExistingQueueTests.cs (1)
329return await response.Content.ReadAsStringAsync();
Listener\ServerTests.cs (1)
68Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync());
OpaqueUpgradeTests.cs (4)
42Assert.Equal(0, response.Content.Headers.ContentLength); 43Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync()); 70Assert.Equal(0, response.Content.Headers.ContentLength); 71Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync());
RequestBodyLimitTests.cs (1)
417return await response.Content.ReadAsStringAsync();
RequestBodyTests.cs (1)
305return await response.Content.ReadAsStringAsync();
ResponseBodyTests.cs (24)
36Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 38Assert.Equal("Hello World", await response.Content.ReadAsStringAsync()); 64Assert.Equal(0, response.Content.Headers.ContentLength); 85Assert.True(0 < (await response.Content.ReadAsByteArrayAsync()).Length); 104Assert.True(0 < (await response.Content.ReadAsByteArrayAsync()).Length); 123Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 125Assert.Equal(new byte[20], await response.Content.ReadAsByteArrayAsync()); 155Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 158var bytes = await response.Content.ReadAsByteArrayAsync(); 180Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 182Assert.Equal(new byte[20], await response.Content.ReadAsByteArrayAsync()); 202Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 204Assert.Equal("Manually Chunked", await response.Content.ReadAsStringAsync()); 226Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 229Assert.Equal(new byte[30], await response.Content.ReadAsByteArrayAsync()); 306Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 309Assert.Equal(new byte[10], await response.Content.ReadAsByteArrayAsync()); 338Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 340Assert.Equal(new byte[10], await response.Content.ReadAsByteArrayAsync()); 366Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 368Assert.Equal(new byte[10], await response.Content.ReadAsByteArrayAsync()); 393Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 395Assert.Equal(new byte[10], await response.Content.ReadAsByteArrayAsync()); 430var payload = await response.Content.ReadAsByteArrayAsync();
ResponseCachingTests.cs (3)
477Assert.Equal(10, response.Content.Headers.ContentLength); 478Assert.Equal(new byte[10], await response.Content.ReadAsByteArrayAsync()); 490Assert.Equal(_fileLength, response.Content.Headers.ContentLength);
ResponseHeaderTests.cs (5)
35Assert.Single(response.Content.Headers); 36Assert.Equal(0, response.Content.Headers.ContentLength); 156var result = response.Content.Headers.TryGetValues("Content-Length", out values); 205Assert.False(response.Content.Headers.Contains("Content-Length")); 208Assert.Equal("Manually Chunked", await response.Content.ReadAsStringAsync());
ResponseSendFileTests.cs (26)
74Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 76Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 93Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 95Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 112Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 114Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 132Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 134Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length); 151Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 153Assert.Equal(FileLength / 2, (await response.Content.ReadAsByteArrayAsync()).Length); 208Assert.False(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 210Assert.Empty((await response.Content.ReadAsByteArrayAsync())); 228Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 231Assert.Equal(FileLength, (await response.Content.ReadAsByteArrayAsync()).Length); 249Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 252Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 270Assert.True(response.Content.Headers.TryGetValues("content-length", out contentLength), "Content-Length"); 273Assert.Empty((await response.Content.ReadAsByteArrayAsync())); 299Assert.False(response.Content.Headers.TryGetValues("content-length", out ignored), "Content-Length"); 301Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 322Assert.False(response.Content.Headers.TryGetValues("content-length", out var contentLength), "Content-Length"); 324Assert.Equal(10, (await response.Content.ReadAsByteArrayAsync()).Length); 346Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length); 364Assert.Equal(FileLength * 2, (await response.Content.ReadAsByteArrayAsync()).Length); 617var bufferTask = response.Content.LoadIntoBufferAsync(); 666var bufferTask = response.Content.LoadIntoBufferAsync();
ResponseTests.cs (4)
37Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync()); 56Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync()); 76Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync()); 93Assert.Equal(string.Empty, await response.Content.ReadAsStringAsync());
ResponseTrailersTests.cs (10)
110Assert.Equal("Hello World", await response.Content.ReadAsStringAsync()); 140Assert.Equal(body.Length.ToString(CultureInfo.InvariantCulture), response.Content.Headers.GetValues(HeaderNames.ContentLength).Single()); 141Assert.Equal(body, await response.Content.ReadAsStringAsync()); 164Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength); 166Assert.Equal(body + body, await response.Content.ReadAsStringAsync()); 189Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength); 192Assert.Equal(body, await response.Content.ReadAsStringAsync()); 215Assert.True(response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var contentLength), HeaderNames.ContentLength); 218Assert.Equal(body, await response.Content.ReadAsStringAsync()); 260Assert.Equal("Hello World", await response.Content.ReadAsStringAsync());
ServerTests.cs (1)
651return await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (3)
LoggingHandler.cs (3)
35if (response.Content != null) 37await response.Content.LoadIntoBufferAsync(); 38var readAsStreamAsync = await response.Content.ReadAsStreamAsync();
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (7)
WebHostTests.cs (7)
89var responseText = await response.Content.ReadAsStringAsync(); 253var responseText1 = await response1.Content.ReadAsStringAsync().DefaultTimeout(); 267var responseText2 = await response2.Content.ReadAsStringAsync().DefaultTimeout(); 324var responseText1 = await response1.Content.ReadAsStringAsync().DefaultTimeout(); 337var responseText2 = await response2.Content.ReadAsStringAsync().DefaultTimeout(); 362var responseText1 = await response1.Content.ReadAsStringAsync().DefaultTimeout(); 374var responseText2 = await response2.Content.ReadAsStringAsync().DefaultTimeout();
Microsoft.AspNetCore.Session.Tests (3)
SessionTests.cs (3)
200Assert.Equal("0", await response.Content.ReadAsStringAsync()); 260Assert.Equal("0", await response.Content.ReadAsStringAsync()); 318Assert.Equal("0", await response.Content.ReadAsStringAsync());
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (2)
HubConnectionTests.cs (2)
1480return await httpResponse.Content.ReadAsStringAsync(); 2697var authHeader = await httpResponse.Content.ReadAsStringAsync();
Microsoft.AspNetCore.SignalR.Tests (2)
EndToEndTests.cs (2)
482token = await response.Content.ReadAsStringAsync(); 656token = await response.Content.ReadAsStringAsync();
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.StaticAssets.Tests (22)
StaticAssetsIntegrationTests.cs (22)
65Assert.Equal(13, response.Content.Headers.ContentLength); 66Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 67Assert.Equal("Hello, World!", await response.Content.ReadAsStringAsync()); 115Assert.Equal(13, response.Content.Headers.ContentLength); 116Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 117Assert.Equal("Hello, World!", await response.Content.ReadAsStringAsync()); 167Assert.Equal(13, response.Content.Headers.ContentLength); 168Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 169Assert.Equal("Hello, World!", await response.Content.ReadAsStringAsync()); 336Assert.Equal(13, response.Content.Headers.ContentLength); 337Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 338Assert.Equal("Hello, World!", await response.Content.ReadAsStringAsync()); 389Assert.Equal(22, response.Content.Headers.ContentLength); 390Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 391Assert.Equal("Hello, World! Modified", await response.Content.ReadAsStringAsync()); 445Assert.Equal(55, response.Content.Headers.ContentLength); 446Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 447var gzipContent = await response.Content.ReadAsStreamAsync(); 764Assert.NotNull(response.Content.Headers.LastModified); 766Assert.Equal(response.Content.Headers.LastModified.Value.Offset, TimeSpan.Zero); 788req2.Headers.IfModifiedSince = resp1.Content.Headers.LastModified; 825var lastModified = resp1.Content.Headers.LastModified.Value;
Microsoft.AspNetCore.StaticFiles.FunctionalTests (13)
FallbackStaticFileTest.cs (4)
60var responseText = await response.Content.ReadAsStringAsync(); 66var responseContent = await response.Content.ReadAsByteArrayAsync(); 109var responseText = await response.Content.ReadAsStringAsync(); 115var responseContent = await response.Content.ReadAsByteArrayAsync();
StaticFileMiddlewareTests.cs (9)
86Assert.Equal("Hi from endpoint.", await response.Content.ReadAsStringAsync()); 113Assert.Equal(response.Content.Headers.LastModified.Value, trimmed); 160var responseContent = await response.Content.ReadAsByteArrayAsync(); 163Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 164Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); 165Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 205Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 206Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); 207Assert.Empty((await response.Content.ReadAsByteArrayAsync()));
Microsoft.AspNetCore.StaticFiles.Tests (123)
CacheHeaderTests.cs (4)
170Assert.NotNull(response.Content.Headers.LastModified); 172Assert.Equal(response.Content.Headers.LastModified.Value.Offset, TimeSpan.Zero); 197.And(req => req.Headers.IfModifiedSince = resp1.Content.Headers.LastModified) 239DateTimeOffset lastModified = resp1.Content.Headers.LastModified.Value;
DefaultFilesMiddlewareTests.cs (5)
76Assert.Equal(requestUrl, await response.Content.ReadAsStringAsync()); // Should not be modified 119Assert.Equal("/SubFolder/", await response.Content.ReadAsStringAsync()); // Should not be modified 158var responseContent = await response.Content.ReadAsStringAsync(); 226Assert.Equal(requestUrlWithSlash + "default.html", await response.Content.ReadAsStringAsync()); // Should be modified and be valid path to file 269Assert.Empty((await response.Content.ReadAsByteArrayAsync()));
DirectoryBrowserMiddlewareTests.cs (13)
134Assert.Equal("Hi from endpoint.", await response.Content.ReadAsStringAsync()); 171Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); 172Assert.True(response.Content.Headers.ContentLength > 0); 173Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); 228Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); 229Assert.True(response.Content.Headers.ContentLength > 0); 230Assert.Equal(response.Content.Headers.ContentLength, (await response.Content.ReadAsByteArrayAsync()).Length); 273Assert.Empty((await response.Content.ReadAsByteArrayAsync())); 371Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); 372Assert.Null(response.Content.Headers.ContentLength); 373Assert.Empty((await response.Content.ReadAsByteArrayAsync()));
RangeHeaderTests.cs (74)
28Assert.Equal("bytes 0-10/62", resp.Content.Headers.ContentRange.ToString()); 29Assert.Equal(11, resp.Content.Headers.ContentLength); 30Assert.Equal("0123456789a", await resp.Content.ReadAsStringAsync()); 51Assert.Null(resp.Content.Headers.ContentRange); 52Assert.Equal(62, resp.Content.Headers.ContentLength); 53Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); 66req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); 70Assert.Equal("bytes 0-10/62", resp.Content.Headers.ContentRange.ToString()); 71Assert.Equal(11, resp.Content.Headers.ContentLength); 72Assert.Equal("0123456789a", await resp.Content.ReadAsStringAsync()); 83req.Headers.Add("If-Modified-Since", original.Content.Headers.LastModified.Value.AddHours(-1).ToString("r")); 87Assert.Equal("bytes 0-10/62", resp.Content.Headers.ContentRange.ToString()); 88Assert.Equal(11, resp.Content.Headers.ContentLength); 89Assert.Equal("0123456789a", await resp.Content.ReadAsStringAsync()); 100req.Headers.Add("If-Modified-Since", original.Content.Headers.LastModified.Value.ToString("r")); 117req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); 122Assert.Equal(original.Content.Headers.LastModified, resp.Content.Headers.LastModified); 123Assert.Null(resp.Content.Headers.ContentRange); 124Assert.Equal(62, resp.Content.Headers.ContentLength); 125Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); 140Assert.Null(resp.Content.Headers.ContentRange); 141Assert.Equal(62, resp.Content.Headers.ContentLength); 142Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); 157Assert.Null(resp.Content.Headers.ContentRange); 158Assert.Equal(62, resp.Content.Headers.ContentLength); 159Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); 172req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r")); 176Assert.Null(resp.Content.Headers.ContentRange); 177Assert.Equal(62, resp.Content.Headers.ContentLength); 178Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); 191req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r")); 195Assert.Null(resp.Content.Headers.ContentRange); 196Assert.Equal(62, resp.Content.Headers.ContentLength); 197Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); 214Assert.Null(resp.Content.Headers.ContentRange); 215Assert.Equal(62, resp.Content.Headers.ContentLength); 216Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); 219req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); 222Assert.Null(resp.Content.Headers.ContentRange); 223Assert.Equal(62, resp.Content.Headers.ContentLength); 224Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); 241Assert.Null(resp.Content.Headers.ContentRange); 242Assert.Equal(62, resp.Content.Headers.ContentLength); 243Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); 246req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.ToString("r")); 249Assert.Null(resp.Content.Headers.ContentRange); 250Assert.Equal(62, resp.Content.Headers.ContentLength); 251Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); 274Assert.NotNull(resp.Content.Headers.ContentRange); 275Assert.Equal("bytes " + expectedRange + "/62", resp.Content.Headers.ContentRange.ToString()); 276Assert.Equal(length, resp.Content.Headers.ContentLength); 277Assert.Equal(expectedData, await resp.Content.ReadAsStringAsync()); 295Assert.NotNull(resp.Content.Headers.ContentRange); 296Assert.Equal("bytes " + expectedRange + "/1", resp.Content.Headers.ContentRange.ToString()); 297Assert.Equal(length, resp.Content.Headers.ContentLength); 298Assert.Equal(expectedData, await resp.Content.ReadAsStringAsync()); 330Assert.Null(resp.Content.Headers.ContentRange); 331Assert.Equal(62, resp.Content.Headers.ContentLength); 332Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); 348Assert.Equal("bytes */62", resp.Content.Headers.ContentRange.ToString()); 363Assert.Null(resp.Content.Headers.ContentRange); 383Assert.Null(resp.Content.Headers.ContentRange); 384Assert.Equal(62, resp.Content.Headers.ContentLength); 385Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); 405Assert.Null(resp.Content.Headers.ContentRange); 406Assert.Equal(62, resp.Content.Headers.ContentLength); 407Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync()); 426Assert.Equal("text/plain", resp.Content.Headers.ContentType.ToString()); 427Assert.Null(resp.Content.Headers.ContentRange); 428Assert.Equal(62, resp.Content.Headers.ContentLength); 429Assert.Equal("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", await resp.Content.ReadAsStringAsync()); 446Assert.Equal("text/plain", resp.Content.Headers.ContentType.ToString()); 447Assert.Equal(string.Empty, await resp.Content.ReadAsStringAsync());
StaticFileMiddlewareTests.cs (27)
134Assert.Equal(response.Content.Headers.LastModified.Value, trimmed); 187var responseContent = await response.Content.ReadAsByteArrayAsync(); 190Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 191Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); 192Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 226var responseContent = await response.Content.ReadAsByteArrayAsync(); 229Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 230Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); 231Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 268var responseContent = await response.Content.ReadAsByteArrayAsync(); 271Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 272Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); 273Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 318var responseContent = await response.Content.ReadAsByteArrayAsync(); 321Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 322Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); 323Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 361var responseContent = await response.Content.ReadAsByteArrayAsync(); 364Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 365Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); 366Assert.Equal(response.Content.Headers.ContentLength, responseContent.Length); 409var responseContent = await response.Content.ReadAsStringAsync(); 412Assert.Equal("text/customfortest+plain", response.Content.Headers.ContentType.ToString()); 482Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); 483Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); 484Assert.Empty((await response.Content.ReadAsByteArrayAsync())); 539Assert.Null(response.Content.Headers.LastModified);
Microsoft.AspNetCore.TestHost (1)
ClientHandler.cs (1)
223bool success = response.Content.Headers.TryAddWithoutValidation(header.Key, (IEnumerable<string>)header.Value);
Microsoft.AspNetCore.TestHost.Tests (31)
ClientHandlerTests.cs (6)
225var responseBody = await response.Content.ReadAsStreamAsync(); 418Assert.Equal("BodyStarted,BodyFinished", await response.Content.ReadAsStringAsync()); 437Assert.Equal("BodyFinished", await response.Content.ReadAsStringAsync()); 454Stream responseStream = await response.Content.ReadAsStreamAsync(); 476Stream responseStream = await response.Content.ReadAsStreamAsync(); 536var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsStringAsync());
RequestLifetimeTests.cs (2)
66var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsByteArrayAsync()); 89var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsByteArrayAsync());
ResponseBodyTests.cs (5)
28var bytes = await response.Content.ReadAsByteArrayAsync(); 45var bytes = await response.Content.ReadAsByteArrayAsync(); 80var responseBytes = await response.Content.ReadAsByteArrayAsync(); 119var responseBytes = await response.Content.ReadAsByteArrayAsync(); 138var stream = await response.Content.ReadAsStreamAsync();
ResponseResetTests.cs (2)
125var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsByteArrayAsync()); 151var ex = await Assert.ThrowsAsync<HttpRequestException>(() => response.Content.ReadAsByteArrayAsync());
TestClientTests.cs (11)
102Assert.Equal("Hello world PUT Response", await response.Content.ReadAsStringAsync().DefaultTimeout()); 120Assert.Equal("Hello world POST Response", await response.Content.ReadAsStringAsync().DefaultTimeout()); 210var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 318var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 372var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 434var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 481var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 532var responseContent = await response.Content.ReadAsStreamAsync().DefaultTimeout(); 956var actual = await message.Content.ReadAsStringAsync(); 983var actual = await message.Content.ReadAsStringAsync(); 1010var actual = await message.Content.ReadAsStringAsync();
TestServerTests.cs (5)
227Assert.Equal("Hello World", await response.Content.ReadAsStringAsync()); 656Assert.Equal("Response", await result.Content.ReadAsStringAsync()); 704Assert.Equal("FoundService:True", await result.Content.ReadAsStringAsync()); 717Assert.Equal("FoundFoo:False", await result.Content.ReadAsStringAsync()); 794var responseBody = await response.Content.ReadAsStringAsync();
Microsoft.AspNetCore.Tests (7)
WebApplicationTests.cs (7)
1607Assert.Equal("new", await oldResult.Content.ReadAsStringAsync()); 2041Assert.Contains("BOOM", await response.Content.ReadAsStringAsync()); 2042Assert.Contains("text/plain", response.Content.Headers.ContentType.MediaType); 2147Assert.Contains("text/plain", response.Content.Headers.ContentType.MediaType); 2149var responseBody = await response.Content.ReadAsStringAsync(); 2172Assert.Null(response.Content.Headers.ContentType); 2174var responseBody = await response.Content.ReadAsStringAsync();
Microsoft.Build.Tasks.Core (7)
DownloadFile.cs (7)
193Log.LogErrorFromResources("DownloadFile.Downloading", SourceUrl, destinationFile.FullName, response.Content.Headers.ContentLength); 203Log.LogMessageFromResources(MessageImportance.High, "DownloadFile.Downloading", SourceUrl, destinationFile.FullName, response.Content.Headers.ContentLength); 205using (Stream responseStream = await response.Content.ReadAsStreamAsync( 326: response.Content?.Headers?.ContentDisposition?.FileName // Attempt to get the file name from the content-disposition header value 353&& destinationFile.Length == response.Content.Headers.ContentLength 354&& response.Content.Headers.LastModified.HasValue 355&& destinationFile.LastWriteTimeUtc > response.Content.Headers.LastModified.Value.UtcDateTime;
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
170await httpResponse.Content.CopyToAsync(outStream).ConfigureAwait(false);
Microsoft.DotNet.Build.Tasks.Feed (4)
src\common\AzureStorageUtils.cs (1)
285var remoteStream = await response.Content.ReadAsStreamAsync();
src\CreateAzureDevOpsFeed.cs (1)
174throw new Exception($"Feed '{baseFeedName}' was not created. Request failed with status code {createFeedResponse.StatusCode}. Exception: {await createFeedResponse.Content.ReadAsStringAsync()}");
src\PublishArtifactsInManifestBase.cs (2)
910string responseBody = await response.Content.ReadAsStringAsync(); 982using var stream = await response.Content.ReadAsStreamAsync(timeoutTokenSource.Token);
Microsoft.DotNet.Deployment.Tasks.Links (8)
Microsoft.DotNet.Git.IssueManager (1)
Clients\AzureDevOpsClient.cs (1)
39AzureDevOpsCommit commitResponse = JsonConvert.DeserializeObject<AzureDevOpsCommit>(await response.Content.ReadAsStringAsync());
Microsoft.DotNet.Helix.Sdk (7)
AzureDevOpsTask.cs (3)
132var message = $"Request to {req.RequestUri} returned failed status {statusCodeValue} {res.ReasonPhrase}\n\n{(res.Content != null ? await res.Content.ReadAsStringAsync() : "")}"; 154var responseContent = await res.Content.ReadAsStringAsync();
FindDotNetCliPackage.cs (3)
215return (await genericResponse.Content.ReadAsStringAsync()).Trim(); 225return (await specificResponse.Content.ReadAsStringAsync()).Trim(); 339string latestVersionContent = await versionResponse.Content.ReadAsStringAsync();
ProvisioningProfileProvider.cs (1)
218await response.Content.CopyToAsync(fileStream);
Microsoft.DotNet.Internal.SymbolHelper (2)
SymbolPromotionHelper.cs (1)
217Stream result = await statusResponse.Content.ReadAsStreamAsync(ct);
SymbolUploadHelperFactory.cs (1)
160using (Stream zipStream = await response.Content.ReadAsStreamAsync(token).ConfigureAwait(false))
Microsoft.DotNet.VersionTools (12)
Automation\GitHubApi\GitHubClient.cs (4)
238await response.Content.ReadAsStringAsync(), 443await response.Content.ReadAsStringAsync(), 460string failureContent = await response.Content.ReadAsStringAsync(); 472JObject responseContent = JObject.Parse(await response.Content.ReadAsStringAsync());
Automation\VstsApi\VstsAdapterClient.cs (6)
202JObject queryResponse = JObject.Parse(await response.Content.ReadAsStringAsync()); 286JObject o = JObject.Parse(await response.Content.ReadAsStringAsync()); 318JObject responseRefs = JObject.Parse(await response.Content.ReadAsStringAsync()); 420await response.Content.ReadAsStringAsync(), 428string failureContent = await response.Content.ReadAsStringAsync(); 440JObject responseContent = JObject.Parse(await response.Content.ReadAsStringAsync());
BuildInfo.cs (2)
59using (var reader = new StreamReader(await response.Content.ReadAsStreamAsync())) 73releaseVersion = (await response.Content.ReadAsStringAsync()).Trim();
Microsoft.Extensions.Http (2)
Logging\LogHelper.cs (2)
123new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Response, response.Headers, response.Content?.Headers, shouldRedactHeaderValue), 162new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Response, response.Headers, response.Content?.Headers, shouldRedactHeaderValue),
Microsoft.Extensions.Http.Diagnostics (4)
Logging\Internal\HttpHeadersReader.cs (1)
69ReadHeaders(response.Content.Headers, _responseHeadersToLog, destination);
Logging\Internal\HttpResponseBodyReader.cs (3)
46var contentType = response.Content.Headers.ContentType; 65var streamToReadFrom = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false); 113foreach (var 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 (6)
Logging\AcceptanceTests.cs (4)
201var responseStream = await content.Content.ReadAsStreamAsync(); 253var responseStream = await content.Content.ReadAsStreamAsync(); 275responseStream = await content.Content.ReadAsStreamAsync(); 689var responseStream = await content.Content.ReadAsStreamAsync();
Logging\HttpResponseBodyReaderTest.cs (1)
157httpResponse.Content.Headers.Add("Content-type", "text/plain");
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.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.Tokenizers (1)
Utils\Helpers.netstandard.cs (1)
27return await response.Content.ReadAsStreamAsync().ConfigureAwait(false);
Microsoft.ML.Tokenizers.Data.Tests (1)
test\Microsoft.ML.Tokenizers.Tests\Utils.cs (1)
24var stream = await response.Content.ReadAsStreamAsync();
Microsoft.ML.Tokenizers.Tests (1)
Utils.cs (1)
24var stream = await response.Content.ReadAsStreamAsync();
Negotiate.Client (12)
Controllers\AuthTestController.cs (12)
35var body = await result.Content.ReadAsStringAsync(); 56var body = await result.Content.ReadAsStringAsync(); 84var body = await result.Content.ReadAsStringAsync(); 107var body = await result.Content.ReadAsStringAsync(); 118body = await result.Content.ReadAsStringAsync(); 140var body = await result.Content.ReadAsStringAsync(); 151body = await result.Content.ReadAsStringAsync(); 173var body = await result.Content.ReadAsStringAsync(); 184body = await result.Content.ReadAsStringAsync(); 204var body = await result.Content.ReadAsStringAsync(); 230var body = await result.Content.ReadAsStringAsync(); 241body = await result.Content.ReadAsStringAsync();
OpenIdConnectSample (1)
Startup.cs (1)
264using (var payload = JsonDocument.Parse(await tokenResponse.Content.ReadAsStringAsync()))
ServerComparison.FunctionalTests (22)
HelloWorldTest.cs (2)
69var responseText = await response.Content.ReadAsStringAsync(); 157var body = await response.Content.ReadAsStringAsync();
NtlmAuthenticationTest.cs (4)
56var responseText = await response.Content.ReadAsStringAsync(); 63responseText = await response.Content.ReadAsStringAsync(); 68responseText = await response.Content.ReadAsStringAsync(); 91responseText = await response.Content.ReadAsStringAsync();
ResponseCompressionTests.cs (8)
147var responseText = await response.Content.ReadAsStringAsync(); 170var responseText = await response.Content.ReadAsStringAsync(); 175Assert.Empty(response.Content.Headers.ContentEncoding); 202var responseText = await response.Content.ReadAsStringAsync(); 205responseText = await ReadCompressedAsStringAsync(response.Content); 207Assert.Single(response.Content.Headers.ContentEncoding); 208Assert.Equal("gzip", response.Content.Headers.ContentEncoding.First()); 221return response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var values) ? values.FirstOrDefault() : null;
ResponseTests.cs (8)
109var responseText = await response.Content.ReadAsStringAsync(); 135var responseText = await response.Content.ReadAsStringAsync(); 155var responseText = await response.Content.ReadAsStringAsync(); 180var responseText = await response.Content.ReadAsStringAsync(); 205var responseText = await response.Content.ReadAsStringAsync(); 230var responseText = await response.Content.ReadAsStringAsync(); 250var responseText = await response.Content.ReadAsStringAsync(); 270return response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out values) ? values.FirstOrDefault() : null;
SocialSample (3)
Startup.cs (3)
144using (var user = JsonDocument.Parse(await response.Content.ReadAsStringAsync())) 205using (var user = JsonDocument.Parse(await response.Content.ReadAsStringAsync())) 333using (var payload = JsonDocument.Parse(await refreshResponse.Content.ReadAsStringAsync()))
Sockets.FunctionalTests (2)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (1)
1126var connectionFacts = await response.Content.ReadAsStringAsync();
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (1)
80var responseBody = await response.Content.ReadAsStreamAsync();
Stress.ApiService (1)
Program.cs (1)
92await response.Content.ReadAsStringAsync();
System.Net.Http (24)
System\Net\Http\HttpClient.cs (5)
193HttpContent c = response.Content; 268HttpContent c = response.Content; 345HttpContent c = response.Content; 487response.Content.LoadIntoBuffer(_maxResponseContentBufferSize, cts.Token); 542await response.Content.LoadIntoBufferAsync(_maxResponseContentBufferSize, cts.Token).ConfigureAwait(false);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (1)
802return tunnelResponse.Content.ReadAsStream(cancellationToken);
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (5)
71Debug.Assert(response.Content != null); 72ICollection<string> contentEncodings = response.Content.Headers.ContentEncoding; 83response.Content = new GZipDecompressedContent(response.Content); 87response.Content = new DeflateDecompressedContent(response.Content); 91response.Content = new BrotliDecompressedContent(response.Content);
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)
233Debug.Assert(_response != null && _response.Content != null); 235var responseContent = (HttpConnectionResponseContent)_response.Content; 1091_response!.Content!.Headers.TryAddWithoutValidation(descriptor, headerValue);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (6)
813else if (response.Content.Headers.ContentLength != null) 815long contentLength = response.Content.Headers.ContentLength.GetValueOrDefault(); 830((HttpConnectionResponseContent)response.Content).SetStream(responseStream); 1304headers = response.Content!.Headers; 2076Debug.Assert(response.Content != null); 2077Stream stream = response.Content.ReadAsStream(cancellationToken);
System.Net.Http.Json (2)
System\Net\Http\Json\HttpClientJsonExtensions.cs (2)
124if (response.Content.Headers.ContentLength is long contentLength && contentLength > contentLengthLimit) 129ValueTask<Stream> task = HttpContentJsonExtensions.GetContentStreamAsync(response.Content, cancellationToken);
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.Net.WebSockets.Client (2)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
193Stream connectedStream = response.Content.ReadAsStream(); 473if (response.Content is null)
Templates.Blazor.Tests (1)
BlazorWebTemplateTest.cs (1)
93Assert.Equal(expectedEncoding, response.Content.Headers.ContentEncoding.Single());
Templates.Tests (2)
IdentityUIPackageTest.cs (2)
133Assert.Contains(versionValidator, await response.Content.ReadAsStringAsync()); 145Assert.Contains(versionValidator, await response.Content.ReadAsStringAsync());