1 override of Body
Microsoft.AspNetCore.Http (1)
262 writes to Body
InMemory.FunctionalTests (5)
InProcessWebSite (2)
Microsoft.AspNetCore.Components.Endpoints.Tests (13)
Microsoft.AspNetCore.Diagnostics.Tests (2)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (2)
Microsoft.AspNetCore.Hosting.Tests (1)
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
Microsoft.AspNetCore.Http.Connections.Tests (37)
Microsoft.AspNetCore.Http.Extensions.Tests (50)
ProblemDetailsServiceTest.cs (6)
26Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest },
52Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest },
71Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest },
87Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest },
102Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest },
122Response = { Body = stream, StatusCode = StatusCodes.Status400BadRequest },
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Http.Results.Tests (60)
Microsoft.AspNetCore.Http.Tests (3)
Microsoft.AspNetCore.HttpLogging (1)
Microsoft.AspNetCore.Mvc.Core.Test (40)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (8)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (4)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (10)
Microsoft.AspNetCore.OpenApi.Tests (4)
Microsoft.AspNetCore.OutputCaching.Tests (3)
Microsoft.AspNetCore.Owin (1)
Microsoft.AspNetCore.Owin.Tests (1)
Microsoft.AspNetCore.ResponseCaching (2)
Microsoft.AspNetCore.ResponseCompression.Tests (1)
Microsoft.AspNetCore.Routing.Tests (8)
Microsoft.AspNetCore.StaticFiles.Tests (1)
568 references to Body
Aspire.Dashboard (1)
Benchmarks (2)
HealthChecksSample (2)
HttpStress (4)
IIS.Microbenchmarks (1)
IIS.Tests (7)
InMemory.FunctionalTests (86)
ChunkedRequestTests.cs (8)
34await response.Body.WriteAsync(buffer, 0, count);
67await response.Body.WriteAsync(bytes, 0, bytes.Length);
184await response.Body.WriteAsync(Encoding.ASCII.GetBytes("Hello World"), 0, 11);
297await response.Body.WriteAsync(Encoding.ASCII.GetBytes("Hello World"), 0, 11);
428await response.Body.WriteAsync(Encoding.ASCII.GetBytes("Hello World"), 0, 11);
603await response.Body.WriteAsync(Encoding.ASCII.GetBytes("Hello World"), 0, 11);
676await response.Body.WriteAsync(Encoding.ASCII.GetBytes("Hello World"), 0, 11);
720await response.Body.WriteAsync(Encoding.ASCII.GetBytes("Hello World"), 0, 11);
Http2\Http2ConnectionTests.cs (21)
61return c.Response.Body.WriteAsync(new byte[1]).AsTask();
93await c.Response.Body.FlushAsync();
96await c.Response.Body.WriteAsync(new byte[65540]);
1181await context.Response.Body.WriteAsync(data, 0, read);
1913await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
2069await context.Response.Body.WriteAsync(data);
3213await context.Response.Body.FlushAsync();
3217await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
3220await context.Response.Body.WriteAsync(_maxData, 0, remainingBytesBeforeBackpressure + 1);
3331await context.Response.Body.WriteAsync(_helloWorldBytes, 0, _helloWorldBytes.Length);
3892return context.Response.Body.WriteAsync(new byte[payloadLength], 0, payloadLength);
3943return context.Response.Body.WriteAsync(new byte[clientMaxFrame], 0, clientMaxFrame);
4236await context.Response.Body.FlushAsync();
4240await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
4243await context.Response.Body.WriteAsync(_maxData, 0, remainingBytesBeforeBackpressure + 1);
4338await context.Response.Body.WriteAsync(_helloWorldBytes, 0, _helloWorldBytes.Length);
4584await context.Response.Body.FlushAsync();
4589await context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
4593var lastWriteTask = context.Response.Body.WriteAsync(_maxData, 0, _maxData.Length);
4764await context.Response.Body.WriteAsync(new byte[windowSize - 1], 0, windowSize - 1);
4766await context.Response.Body.WriteAsync(new byte[windowSize], 0, windowSize);
Http2\Http2StreamTests.cs (13)
1643await context.Response.Body.FlushAsync();
3193await context.Response.Body.WriteAsync(new byte[10], 0, 10);
3259await context.Response.Body.WriteAsync(new byte[10], 0, 10);
3302await context.Response.Body.WriteAsync(new byte[10], 0, 10);
3349await context.Response.Body.WriteAsync(new byte[10], 0, 10);
3386await context.Response.Body.WriteAsync(new byte[10], 0, 10);
3391await context.Response.Body.WriteAsync(new byte[11], 0, 11);
3488await context.Response.Body.WriteAsync(new byte[windowSize + 1], 0, windowSize + 1);
3489context.Response.Body.Write(new byte[1], 0, 1);
3830await context.Response.Body.FlushAsync(); // https://github.com/aspnet/KestrelHttpServer/issues/3031
4385await response.Body.WriteAsync(Encoding.ASCII.GetBytes("hello, world"));
4535await httpContext.Response.Body.WriteAsync(Encoding.ASCII.GetBytes("hello, world"));
4585await response.Body.WriteAsync(Encoding.ASCII.GetBytes("hello, world\r\n"));
ResponseTests.cs (13)
1766await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, 0, response.Length));
1853await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, 0, response.Length / 2));
1854await httpContext.Response.Body.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2));
3424var ioEx = Assert.Throws<InvalidOperationException>(() => context.Response.Body.Write(Encoding.ASCII.GetBytes("What!?"), 0, 6));
3426await context.Response.Body.WriteAsync(Encoding.ASCII.GetBytes("Hello1"), 0, 6);
3452context.Response.Body.Write(Encoding.ASCII.GetBytes("Hello1"), 0, 6);
3483context.Response.Body.Write(Encoding.ASCII.GetBytes("Hello!"), 0, 6);
3520var ioEx = Assert.Throws<InvalidOperationException>(() => context.Response.Body.Write(Encoding.ASCII.GetBytes("What!?"), 0, 6));
3750await httpContext.Response.Body.WriteAsync(Encoding.ASCII.GetBytes("hello, world"));
3786await response.Body.WriteAsync(Encoding.ASCII.GetBytes("hello, world\r\n"));
4337var oldBody = httpContext.Response.Body;
4341await httpContext.Response.Body.WriteAsync(new byte[1]);
4343Assert.Equal(2, httpContext.Response.Body.Length);
InProcessWebSite (19)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.cs (19)
212await context.Response.Body.WriteAsync(new byte[100], 0, 100);
345var originalBody = ctx.Response.Body;
349Assert.Same(body, ctx.Response.Body);
649await ctx.Response.Body.FlushAsync();
665await ctx.Response.Body.FlushAsync();
676await ctx.Response.Body.FlushAsync();
697await ctx.Response.Body.FlushAsync();
722await ctx.Response.Body.WriteAsync(data, 0, data.Length);
742await ctx.Response.Body.FlushAsync();
744await ctx.Response.Body.FlushAsync();
769await ctx.Request.Body.CopyToAsync(ctx.Response.Body);
886await ctx.Response.Body.WriteAsync(new byte[1], -1, 0);
897await ctx.Response.Body.WriteAsync(new byte[1], 2, 0);
908await ctx.Response.Body.WriteAsync(new byte[1], 0, -1);
919await ctx.Response.Body.WriteAsync(new byte[1], 0, -1);
930await ctx.Response.Body.WriteAsync(new byte[3], 1, 3);
945await ctx.Response.Body.WriteAsync(null, 0, 0);
949await ctx.Response.Body.WriteAsync(null, 0, 0);
1057await ctx.Response.Body.FlushAsync();
Interop.FunctionalTests (13)
LargeResponseApp (1)
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
Microsoft.AspNetCore.Authentication.Test (3)
Microsoft.AspNetCore.Components.Endpoints (6)
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
Microsoft.AspNetCore.CookiePolicy.Test (2)
Microsoft.AspNetCore.Diagnostics (2)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
Microsoft.AspNetCore.Diagnostics.HealthChecks (3)
Microsoft.AspNetCore.Diagnostics.Tests (4)
Microsoft.AspNetCore.Grpc.JsonTranscoding (5)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (42)
UnaryServerCallHandlerTests.cs (42)
80httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
81using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
118httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
119using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
149httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
150var sr = new StreamReader(httpContext.Response.Body);
178httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
179using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
715httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
716using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
747httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
748using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
785httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
786using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
815httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
816using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
839httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
840using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
864httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
865using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
931httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
932using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1009httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1010using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1051httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1052using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1081httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1082using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1110httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1111using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1153httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1154using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1207httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1208using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1234httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1235using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1366httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1367var responseXml = XDocument.Load(httpContext.Response.Body);
1473httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1474using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
1734httpContext.Response.Body.Seek(0, SeekOrigin.Begin);
1735using var responseJson = JsonDocument.Parse(httpContext.Response.Body);
Microsoft.AspNetCore.HostFiltering (1)
Microsoft.AspNetCore.Hosting (1)
Microsoft.AspNetCore.Hosting.Tests (2)
Microsoft.AspNetCore.Http.Abstractions.Tests (4)
Microsoft.AspNetCore.Http.Connections (5)
Microsoft.AspNetCore.Http.Connections.Tests (13)
Microsoft.AspNetCore.Http.Extensions (3)
Microsoft.AspNetCore.Http.Extensions.Tests (5)
Microsoft.AspNetCore.Http.Microbenchmarks (2)
Microsoft.AspNetCore.Http.Results (4)
Microsoft.AspNetCore.Http.Results.Tests (46)
src\Shared\ResultsTests\FileStreamResultTestBase.cs (19)
56httpResponse.Body.Seek(0, SeekOrigin.Begin);
57var streamReader = new StreamReader(httpResponse.Body);
97httpResponse.Body.Seek(0, SeekOrigin.Begin);
98var streamReader = new StreamReader(httpResponse.Body);
138httpResponse.Body.Seek(0, SeekOrigin.Begin);
139var streamReader = new StreamReader(httpResponse.Body);
175httpResponse.Body.Seek(0, SeekOrigin.Begin);
176var streamReader = new StreamReader(httpResponse.Body);
208httpResponse.Body.Seek(0, SeekOrigin.Begin);
209var streamReader = new StreamReader(httpResponse.Body);
241httpResponse.Body.Seek(0, SeekOrigin.Begin);
242var streamReader = new StreamReader(httpResponse.Body);
280httpResponse.Body.Seek(0, SeekOrigin.Begin);
281var streamReader = new StreamReader(httpResponse.Body);
316httpResponse.Body.Seek(0, SeekOrigin.Begin);
317var streamReader = new StreamReader(httpResponse.Body);
357httpResponse.Body.Seek(0, SeekOrigin.Begin);
358var streamReader = new StreamReader(httpResponse.Body);
438Assert.Equal(0, httpContext.Response.Body.Length);
Microsoft.AspNetCore.Http.Tests (3)
Microsoft.AspNetCore.HttpLogging (2)
Microsoft.AspNetCore.Identity.InMemory.Test (1)
Microsoft.AspNetCore.Mvc.Abstractions (3)
Microsoft.AspNetCore.Mvc.Core (8)
Microsoft.AspNetCore.Mvc.Core.Test (50)
src\Shared\ResultsTests\FileStreamResultTestBase.cs (19)
56httpResponse.Body.Seek(0, SeekOrigin.Begin);
57var streamReader = new StreamReader(httpResponse.Body);
97httpResponse.Body.Seek(0, SeekOrigin.Begin);
98var streamReader = new StreamReader(httpResponse.Body);
138httpResponse.Body.Seek(0, SeekOrigin.Begin);
139var streamReader = new StreamReader(httpResponse.Body);
175httpResponse.Body.Seek(0, SeekOrigin.Begin);
176var streamReader = new StreamReader(httpResponse.Body);
208httpResponse.Body.Seek(0, SeekOrigin.Begin);
209var streamReader = new StreamReader(httpResponse.Body);
241httpResponse.Body.Seek(0, SeekOrigin.Begin);
242var streamReader = new StreamReader(httpResponse.Body);
280httpResponse.Body.Seek(0, SeekOrigin.Begin);
281var streamReader = new StreamReader(httpResponse.Body);
316httpResponse.Body.Seek(0, SeekOrigin.Begin);
317var streamReader = new StreamReader(httpResponse.Body);
357httpResponse.Body.Seek(0, SeekOrigin.Begin);
358var streamReader = new StreamReader(httpResponse.Body);
438Assert.Equal(0, httpContext.Response.Body.Length);
Microsoft.AspNetCore.Mvc.Formatters.Xml (3)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (23)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (12)
Microsoft.AspNetCore.Mvc.Razor (2)
Microsoft.AspNetCore.Mvc.ViewFeatures (3)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
Microsoft.AspNetCore.OutputCaching.Tests (1)
Microsoft.AspNetCore.Owin.Tests (1)
Microsoft.AspNetCore.ResponseCaching (1)
Microsoft.AspNetCore.ResponseCaching.Tests (1)
Microsoft.AspNetCore.ResponseCompression.Tests (12)
Microsoft.AspNetCore.Rewrite (1)
Microsoft.AspNetCore.Routing.Tests (4)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (76)
RequestBodyLimitTests.cs (10)
33httpContext.Response.Body.Write(input, 0, read);
56await httpContext.Response.Body.WriteAsync(input, 0, read);
77httpContext.Response.Body.EndWrite(httpContext.Response.Body.BeginWrite(input, 0, read, null, null));
100httpContext.Response.Body.Write(input, 0, read);
123await httpContext.Response.Body.WriteAsync(input, 0, read);
144httpContext.Response.Body.EndWrite(httpContext.Response.Body.BeginWrite(input, 0, read, null, null));
373await httpContext.Response.Body.WriteAsync(input, 0, read);
397await httpContext.Response.Body.WriteAsync(input, 0, read);
RequestBodyTests.cs (8)
34httpContext.Response.Body.Write(input, 0, read);
56httpContext.Response.Body.Write(input, 0, read);
75await httpContext.Response.Body.WriteAsync(input, 0, read);
95await httpContext.Response.Body.WriteAsync(input, 0, read);
112httpContext.Response.Body.EndWrite(httpContext.Response.Body.BeginWrite(input, 0, read, null, null));
197await httpContext.Response.Body.WriteAsync(input, 0, 10);
231await httpContext.Response.Body.WriteAsync(input, 0, read);
RequestTests.cs (5)
59httpContext.Response.Body.Write(body, 0, body.Length);
123httpContext.Response.Body.Write(body, 0, body.Length);
186httpContext.Response.Body.Write(body, 0, body.Length);
230httpContext.Response.Body.Write(body, 0, body.Length);
327httpContext.Response.Body.Write(body, 0, body.Length);
ResponseBodyTests.cs (19)
115httpContext.Response.Body.Write(new byte[10], 0, 10);
116return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
146httpContext.Response.Body.Write(new byte[WriteSize], 0, WriteSize);
148await httpContext.Response.Body.WriteAsync(new byte[WriteSize], 0, WriteSize);
171httpContext.Response.Body.Write(new byte[10], 0, 10);
172await httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
173await httpContext.Response.Body.FlushAsync();
193Stream stream = httpContext.Response.Body;
216Stream stream = httpContext.Response.Body;
254return httpContext.Response.Body.WriteAsync(new byte[5], 0, 5);
269await httpContext.Response.Body.WriteAsync(new byte[5], 0, 5);
271httpContext.Response.Body.WriteAsync(new byte[6], 0, 6));
290httpContext.Response.Body.Write(new byte[10], 0, 10);
291httpContext.Response.Body.Write(new byte[9], 0, 9);
329httpContext.Response.Body.Write(new byte[10], 0, 10);
357httpContext.Response.Body.EndWrite(httpContext.Response.Body.BeginWrite(new byte[10], 0, 10, null, null));
385return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
413var body = httpContext.Response.Body;
ResponseCachingTests.cs (18)
54return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
74return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
95return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
116return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
141return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
161return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
181return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
201return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
221return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
242return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
266return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
289return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
309return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
330return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
350httpContext.Response.Body.FlushAsync();
351return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
371await httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
434return httpContext.Response.Body.WriteAsync(new byte[10], 0, 10);
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (3)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.SpaProxy (1)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.StaticAssets (1)
Microsoft.AspNetCore.StaticFiles (1)
Microsoft.AspNetCore.TestHost (2)
Microsoft.AspNetCore.TestHost.Tests (35)
HttpContextBuilderTests.cs (13)
42Assert.NotNull(context.Response.Body);
128c.Response.Body.Write(bytes, 0, bytes.Length);
131c.Response.Body.Write(bytes, 0, bytes.Length);
138var reader = new StreamReader(context.Response.Body);
162var reader = new StreamReader(context.Response.Body);
177await c.Response.Body.FlushAsync();
187Assert.Equal("BodyFinished", new StreamReader(context.Response.Body).ReadToEnd());
199await c.Response.Body.FlushAsync();
208var responseStream = context.Response.Body;
248await c.Response.Body.FlushAsync();
257var responseStream = context.Response.Body;
298Assert.Equal(11, context.Response.Body.Read(new byte[100], 0, 100));
300var ex = Assert.Throws<IOException>(() => context.Response.Body.Read(new byte[100], 0, 100));
ResponseCompressionSample (1)
RoutingSandbox (3)
RoutingWebSite (2)
ServerComparison.TestSites (2)
SignalR.Client.FunctionalTestApp (1)
Sockets.FunctionalTests (4)