1 override of BodyWriter
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpResponse.cs (1)
122public override PipeWriter BodyWriter
383 references to BodyWriter
CustomAuthorizationFailureResponse (1)
Authorization\SampleAuthorizationMiddlewareResultHandler.cs (1)
58httpContext.Response.OnStarting(() => httpContext.Response.BodyWriter.WriteAsync(Encoding.UTF8.GetBytes(message)).AsTask());
InMemory.FunctionalTests (309)
ChunkedRequestTests.cs (4)
51await response.BodyWriter.WriteAsync(readResult.Buffer.ToArray()); 931await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 983await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 1094await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11));
ChunkedResponseTests.cs (71)
27await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello "), 0, 6)); 28await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("World!"), 0, 6)); 91await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello "), 0, 6)); 92await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("World!"), 0, 6)); 202var memory = httpContext.Response.BodyWriter.GetMemory(length); 205httpContext.Response.BodyWriter.Advance(length); 206await httpContext.Response.BodyWriter.FlushAsync(); 244var memory = httpContext.Response.BodyWriter.GetMemory(100000); 246httpContext.Response.BodyWriter.Advance(partialLength); 247await httpContext.Response.BodyWriter.FlushAsync(); 317await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello "), 0, 6)); 318await response.BodyWriter.WriteAsync(new Memory<byte>(new byte[0], 0, 0)); 319await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("World!"), 0, 6)); 397await response.BodyWriter.WriteAsync(new Memory<byte>(new byte[0], 0, 0)); 427await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World!"), 0, 12)); 460await response.BodyWriter.WriteAsync(new Memory<byte>(new byte[0], 0, 0)); 494await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello "), 0, 6)); 499await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("World!"), 0, 6)); 540await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("6\r\nHello \r\n"), 0, 11)); 541await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("6\r\nWorld!\r\n"), 0, 11)); 542await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("0\r\n\r\n"), 0, 5)); 578var memory = response.BodyWriter.GetMemory(); 581response.BodyWriter.Advance(6); 583memory = response.BodyWriter.GetMemory(); 586response.BodyWriter.Advance(6); 588await response.BodyWriter.FlushAsync(); 621var memory = response.BodyWriter.GetMemory(); 624response.BodyWriter.Advance(6); 626memory = response.BodyWriter.GetMemory(); 629response.BodyWriter.Advance(6); 631await response.BodyWriter.FlushAsync(); 666var memory = response.BodyWriter.GetMemory(5000); 672response.BodyWriter.Advance(memory.Length); 674memory = response.BodyWriter.GetMemory(); 677response.BodyWriter.Advance(6); 679await response.BodyWriter.FlushAsync(); 720await response.BodyWriter.FlushAsync(); 722var memory = response.BodyWriter.GetMemory(5000); 728response.BodyWriter.Advance(memory.Length); 730memory = response.BodyWriter.GetMemory(); 733response.BodyWriter.Advance(6); 735await response.BodyWriter.FlushAsync(); 778var memory = response.BodyWriter.GetMemory(); 784response.BodyWriter.Advance(length); 786var secondMemory = response.BodyWriter.GetMemory(6); 790response.BodyWriter.Advance(6); 792await response.BodyWriter.FlushAsync(); 833var memory = response.BodyWriter.GetMemory(4096); 836response.BodyWriter.Advance(6); 840response.BodyWriter.Advance(6); 877var span = response.BodyWriter.GetSpan(4096); 880response.BodyWriter.Advance(6); 884response.BodyWriter.Advance(6); 922var memory = response.BodyWriter.GetMemory(4096); 926response.BodyWriter.Advance(6); 961var memory = response.BodyWriter.GetMemory(4096); 964response.BodyWriter.Advance(6); 1003var memory = response.BodyWriter.GetMemory(0); 1008memory = response.BodyWriter.GetMemory(1000000); 1040var memory = response.BodyWriter.GetMemory(0); 1044memory = response.BodyWriter.GetMemory(1000000); 1076var memory = response.BodyWriter.GetMemory(4096); 1079response.BodyWriter.Advance(writeSize); 1080await response.BodyWriter.FlushAsync(); 1115var memory = response.BodyWriter.GetMemory(4096); 1118response.BodyWriter.Advance(writeSize); 1119await response.BodyWriter.FlushAsync(); 1150var memory = response.BodyWriter.GetMemory(4096); 1153response.BodyWriter.Advance(6); 1156response.BodyWriter.Advance(6); 1159await response.BodyWriter.WriteAsync(Encoding.ASCII.GetBytes("hello, world"));
ConnectionMiddlewareTests.cs (3)
309await context.Response.BodyWriter.WriteAsync(Encoding.ASCII.GetBytes("Hello ")); 310await context.Response.BodyWriter.FlushAsync(); 311await context.Response.BodyWriter.WriteAsync(Encoding.ASCII.GetBytes("World!"));
Http2\Http2ConnectionTests.cs (18)
1386await context.Response.BodyWriter.FlushAsync(); 1399await context.Response.BodyWriter.WriteAsync(readResult.Buffer.ToArray()); 5902var memory = c.Response.BodyWriter.GetMemory(); 5903c.Response.BodyWriter.Advance(memory.Length); 5905Assert.Equal(length, c.Response.BodyWriter.UnflushedBytes); 5907memory = c.Response.BodyWriter.GetMemory(); 5908c.Response.BodyWriter.Advance(memory.Length); 5911Assert.Equal(length, c.Response.BodyWriter.UnflushedBytes); 5913await c.Response.BodyWriter.FlushAsync(); 5915Assert.Equal(0, c.Response.BodyWriter.UnflushedBytes); 5958var memory = c.Response.BodyWriter.GetMemory(); 5959c.Response.BodyWriter.Advance(memory.Length); 5961Assert.Equal(length, c.Response.BodyWriter.UnflushedBytes); 5963memory = c.Response.BodyWriter.GetMemory(); 5964c.Response.BodyWriter.Advance(memory.Length); 5967Assert.Equal(length, c.Response.BodyWriter.UnflushedBytes); 5969await c.Response.BodyWriter.FlushAsync(); 5971Assert.Equal(0, c.Response.BodyWriter.UnflushedBytes);
Http2\Http2StreamTests.cs (73)
189return context.Request.BodyReader.CopyToAsync(context.Response.BodyWriter); 240return context.Request.BodyReader.CopyToAsync(context.Response.BodyWriter); 2987context.Response.BodyWriter.GetMemory(windowSize + 1); 2988context.Response.BodyWriter.Advance(windowSize + 1); 3051var s = context.Response.BodyWriter.GetMemory(1); 3053context.Response.BodyWriter.Advance(1); 3226context.Response.BodyWriter.GetMemory(); 3227context.Response.BodyWriter.Advance(10); 3228await context.Response.BodyWriter.FlushAsync(); 3877var memory = response.BodyWriter.GetMemory(); 3880response.BodyWriter.Advance(6); 3882memory = response.BodyWriter.GetMemory(); 3885response.BodyWriter.Advance(6); 3924var memory = response.BodyWriter.GetMemory(); 3927response.BodyWriter.Advance(6); 3929memory = response.BodyWriter.GetMemory(); 3932response.BodyWriter.Advance(6); 3970var memory = response.BodyWriter.GetMemory(); 3974response.BodyWriter.Advance(memory.Length); 3976memory = response.BodyWriter.GetMemory(); 3979response.BodyWriter.Advance(6); 3981await response.BodyWriter.FlushAsync(); 4022await response.BodyWriter.FlushAsync(); 4024var memory = response.BodyWriter.GetMemory(); 4027response.BodyWriter.Advance(memory.Length); 4029memory = response.BodyWriter.GetMemory(); 4032response.BodyWriter.Advance(6); 4034await response.BodyWriter.FlushAsync(); 4075await response.BodyWriter.FlushAsync(); 4077var memory = response.BodyWriter.GetMemory(4096); 4080response.BodyWriter.Advance(6); 4084response.BodyWriter.Advance(6); 4121await response.BodyWriter.FlushAsync(); 4125var span = response.BodyWriter.GetSpan(); 4128response.BodyWriter.Advance(6); 4132response.BodyWriter.Advance(6); 4171var memory = response.BodyWriter.GetMemory(4096); 4174response.BodyWriter.Advance(6); 4218var memory = response.BodyWriter.GetMemory(0); 4221memory = response.BodyWriter.GetMemory(4096); 4258var memory = response.BodyWriter.GetMemory(0); 4261memory = response.BodyWriter.GetMemory(4096); 4300var result = await httpContext.Response.BodyWriter.WriteAsync(payload); 4331httpContext.Response.BodyWriter.CancelPendingFlush(); 4333var cancelledResult = await httpContext.Response.BodyWriter.WriteAsync(payload); 4337var goodResult = await httpContext.Response.BodyWriter.WriteAsync(secondPayload); 4375var memory = response.BodyWriter.GetMemory(4096); 4378response.BodyWriter.Advance(6); 4381response.BodyWriter.Advance(6); 4383await response.BodyWriter.FlushAsync(); 4386await response.BodyWriter.WriteAsync(Encoding.ASCII.GetBytes("hello, world")); 4443var span = response.BodyWriter.GetSpan(4096); 4446response.BodyWriter.Advance(6); 4450response.BodyWriter.Advance(6); 4491var memory = response.BodyWriter.GetMemory(4096); 4494response.BodyWriter.Advance(6); 4498response.BodyWriter.Advance(6); 4576var memory = response.BodyWriter.GetMemory(4096); 4580response.BodyWriter.Advance(6); 4583response.BodyWriter.Advance(8); 4584await response.BodyWriter.FlushAsync(); 4586await response.BodyWriter.WriteAsync(Encoding.ASCII.GetBytes("hello, world\r\n")); 4638context.Response.BodyWriter.Complete(); 4670context.Response.BodyWriter.Complete(); 4704context.Response.BodyWriter.Complete(expectedException); 5103var memory = context.Response.BodyWriter.GetMemory(12); 5107context.Response.BodyWriter.Advance(memory.Length); 5155var buffer = context.Response.BodyWriter.GetMemory(); 5157context.Response.BodyWriter.Advance(length); 5386var ex = Assert.Throws<InvalidOperationException>(() => context.Response.BodyWriter.Complete()); 5897await response.BodyWriter.FlushAsync(); 5901var memory = response.BodyWriter.GetMemory(sizeHint); 5906response.BodyWriter.Advance(sizeHint);
Http2\Http2WebSocketTests.cs (3)
458ex = await Assert.ThrowsAsync<InvalidOperationException>(() => context.Response.BodyWriter.WriteAsync(new byte[1] { 0x00 }).AsTask()); 467ex = await Assert.ThrowsAsync<InvalidOperationException>(() => context.Response.BodyWriter.WriteAsync(new byte[1] { 0x00 }).AsTask()); 534await context.Response.BodyWriter.WriteAsync(new byte[1] { 0x02 });
Http3\Http3ConnectionTests.cs (16)
607var memory = c.Response.BodyWriter.GetMemory(); 608c.Response.BodyWriter.Advance(memory.Length); 610Assert.Equal(length, c.Response.BodyWriter.UnflushedBytes); 612memory = c.Response.BodyWriter.GetMemory(); 613c.Response.BodyWriter.Advance(memory.Length); 616Assert.Equal(length, c.Response.BodyWriter.UnflushedBytes); 618await c.Response.BodyWriter.FlushAsync(); 620Assert.Equal(0, c.Response.BodyWriter.UnflushedBytes); 661var memory = c.Response.BodyWriter.GetMemory(); 662c.Response.BodyWriter.Advance(memory.Length); 664Assert.Equal(length, c.Response.BodyWriter.UnflushedBytes); 666memory = c.Response.BodyWriter.GetMemory(); 667c.Response.BodyWriter.Advance(memory.Length); 670Assert.Equal(length, c.Response.BodyWriter.UnflushedBytes); 672await c.Response.BodyWriter.FlushAsync(); 674Assert.Equal(0, c.Response.BodyWriter.UnflushedBytes);
Http3\Http3StreamTests.cs (13)
722await context.Response.BodyWriter.FlushAsync(); 729await context.Response.BodyWriter.WriteAsync(new byte[] { data[i] }); 768var result = await context.Response.BodyWriter.WriteAsync(payload); 797context.Response.BodyWriter.CancelPendingFlush(); 799var cancelledResult = await context.Response.BodyWriter.WriteAsync(payload); 803var goodResult = await context.Response.BodyWriter.WriteAsync(secondPayload); 1437var memory = context.Response.BodyWriter.GetMemory(12); 1441context.Response.BodyWriter.Advance(memory.Length); 1482var buffer = context.Response.BodyWriter.GetMemory(); 1484context.Response.BodyWriter.Advance(length); 1662var ex = Assert.Throws<InvalidOperationException>(() => context.Response.BodyWriter.Complete()); 2996var memory = context.Response.BodyWriter.GetMemory(sizeHint); 3000context.Response.BodyWriter.Advance(memory.Length);
KestrelMetricsTests.cs (4)
286await c.Response.BodyWriter.WriteAsync(Encoding.UTF8.GetBytes("Hello world")); 287await c.Response.BodyWriter.FlushAsync(); 540await context.Response.BodyWriter.FlushAsync(); 621await context.Response.BodyWriter.FlushAsync();
RequestTests.cs (5)
63if (context.Response.BodyWriter == bodyPipe) 67bodyPipe = context.Response.BodyWriter; 1923await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 1969await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 2052await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11));
ResponseTests.cs (92)
82await context.Response.BodyWriter.FlushAsync(); 161var writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout(); 168writeTask = context.Response.BodyWriter.WriteAsync(new Memory<byte>(data, 0, data.Length), cts.Token).AsTask().DefaultTimeout(); 223var result = await context.Response.BodyWriter.WriteAsync(payload); 248context.Response.BodyWriter.CancelPendingFlush(); 250var cancelledResult = await context.Response.BodyWriter.WriteAsync(payload); 254var goodResult = await context.Response.BodyWriter.WriteAsync(secondPayload); 916await httpContext.Response.BodyWriter.FlushAsync(); 960await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("hello,"), 0, 6)); 961await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes(" world"), 0, 6)); 1041await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1076await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1174completeEx = Assert.Throws<InvalidOperationException>(() => httpContext.Response.BodyWriter.Complete()); 1312await httpContext.Response.BodyWriter.FlushAsync(); 1474await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("hello, world"), 0, 12)); 1724await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)); 1808await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length / 2)); 1809await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2)); 1896return httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length)).AsTask(); 1936await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, 0, response.Length / 2)); 1937await httpContext.Response.BodyWriter.WriteAsync(new Memory<byte>(response, response.Length / 2, response.Length - response.Length / 2)); 2493var writeException = await Assert.ThrowsAsync<ObjectDisposedException>(async () => await response.BodyWriter.FlushAsync()); 2551await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 2597await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 2644await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 2690await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 2735await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello"), 0, 5)); 2770await response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello World"), 0, 11)); 3257WriteStringWithoutFlushing(httpContext.Response.BodyWriter, expectedString); 3288await httpContext.Response.BodyWriter.FlushAsync(); 3523return context.Response.BodyWriter.WriteAsync(new Memory<byte>(Encoding.ASCII.GetBytes("Hello!"), 0, 6)).AsTask(); 3583Assert.Throws<ArgumentOutOfRangeException>(() => response.BodyWriter.Advance(-1)); 3614Assert.Throws<ArgumentOutOfRangeException>(() => response.BodyWriter.Advance(-1)); 3644Assert.Throws<InvalidOperationException>(() => response.BodyWriter.Advance(1)); 3677var span = response.BodyWriter.GetSpan(4096); 3680response.BodyWriter.Advance(6); 3684response.BodyWriter.Advance(6); 3717var memory = response.BodyWriter.GetMemory(4096); 3720response.BodyWriter.Advance(6); 3724response.BodyWriter.Advance(6); 3778var memory = response.BodyWriter.GetMemory(4096); 3781response.BodyWriter.Advance(6); 3784response.BodyWriter.Advance(8); 3787await response.BodyWriter.WriteAsync(Encoding.ASCII.GetBytes("hello, world\r\n")); 3817httpContext.Response.BodyWriter.Complete(); 3845httpContext.Response.BodyWriter.Complete(); 3877await httpContext.Response.BodyWriter.CompleteAsync(); 3914var memory = httpContext.Response.BodyWriter.GetMemory(); 3916httpContext.Response.BodyWriter.Advance(1); 3917await httpContext.Response.BodyWriter.FlushAsync(); 3960var memory = httpContext.Response.BodyWriter.GetMemory(); 3962httpContext.Response.BodyWriter.Advance(1); 3963await httpContext.Response.BodyWriter.FlushAsync(); 4013var memory = httpContext.Response.BodyWriter.GetMemory(); 4015httpContext.Response.BodyWriter.Advance(1); 4016await httpContext.Response.BodyWriter.FlushAsync(); 4020var memory = httpContext.Response.BodyWriter.GetMemory(); 4022httpContext.Response.BodyWriter.Advance(1); 4023await httpContext.Response.BodyWriter.FlushAsync(); 4073Assert.Throws<InvalidOperationException>(() => httpContext.Response.BodyWriter.Advance(1)); 4077var memory = httpContext.Response.BodyWriter.GetMemory(); 4116httpContext.Response.BodyWriter.Complete(expectedException); 4145httpContext.Response.BodyWriter.Complete(); 4146var memory = httpContext.Response.BodyWriter.GetMemory(); // Shouldn't throw 4176httpContext.Response.BodyWriter.Complete(); 4177var memory = httpContext.Response.BodyWriter.GetMemory(); // Shouldn't throw 4205var memory = httpContext.Response.BodyWriter.GetMemory(); 4211memory = httpContext.Response.BodyWriter.GetMemory(); 4240var memory = httpContext.Response.BodyWriter.GetMemory(); 4244Assert.Throws<InvalidOperationException>(() => httpContext.Response.BodyWriter.Advance(1)); 4274httpContext.Response.BodyWriter.Complete(); 4276writeEx = Assert.Throws<InvalidOperationException>(() => httpContext.Response.BodyWriter.GetMemory()); 4306var BodyWriter1 = httpContext.Response.BodyWriter; 4309var BodyWriter2 = httpContext.Response.BodyWriter; 4340await httpContext.Response.BodyWriter.WriteAsync(new byte[1]); 4579var memory = context.Response.BodyWriter.GetMemory(); 4580context.Response.BodyWriter.Advance(memory.Length); 4582Assert.Equal(length, context.Response.BodyWriter.UnflushedBytes); 4584memory = context.Response.BodyWriter.GetMemory(); 4585context.Response.BodyWriter.Advance(memory.Length); 4588Assert.Equal(length, context.Response.BodyWriter.UnflushedBytes); 4590await context.Response.BodyWriter.FlushAsync(); 4592Assert.Equal(0, context.Response.BodyWriter.UnflushedBytes); 4631await context.Response.BodyWriter.FlushAsync(); 4634var memory = context.Response.BodyWriter.GetMemory(); 4635context.Response.BodyWriter.Advance(memory.Length); 4637Assert.Equal(length, context.Response.BodyWriter.UnflushedBytes); 4639memory = context.Response.BodyWriter.GetMemory(); 4640context.Response.BodyWriter.Advance(memory.Length); 4644Assert.Equal(length + 7, context.Response.BodyWriter.UnflushedBytes); 4646await context.Response.BodyWriter.FlushAsync(); 4648Assert.Equal(0, context.Response.BodyWriter.UnflushedBytes);
src\Servers\Kestrel\shared\test\TestApp.cs (6)
54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 57await response.BodyWriter.FlushAsync(); 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length); 75await response.BodyWriter.FlushAsync();
UpgradeTests.cs (1)
34await Assert.ThrowsAsync<InvalidOperationException>(() => context.Response.BodyWriter.WriteAsync(new byte[1]).AsTask());
Interop.FunctionalTests (18)
Http2\Http2RequestTests.cs (2)
243var memory = c.Response.BodyWriter.GetMemory(randomBytes.Length); 251c.Response.BodyWriter.Advance(randomBytes.Length);
Http3\Http3RequestTests.cs (9)
1077await context.Response.BodyWriter.FlushAsync(); 1092context.Response.BodyWriter.GetSpan(data.Length); 1093context.Response.BodyWriter.Advance(data.Length); 1095await context.Response.BodyWriter.FlushAsync(); 1175await context.Response.BodyWriter.FlushAsync(); 1187var memory = context.Response.BodyWriter.GetMemory(); 1197context.Response.BodyWriter.Advance(memory.Length); 1198var flushResult = await context.Response.BodyWriter.FlushAsync(); 1357await context.Response.BodyWriter.WriteAsync(TestData);
HttpClientHttp2InteropTests.cs (7)
81await context.Request.BodyReader.CopyToAsync(context.Response.BodyWriter).DefaultTimeout(); 167await context.Request.BodyReader.CopyToAsync(context.Response.BodyWriter).DefaultTimeout(); 282await context.Response.BodyWriter.WriteAsync(sequence.First).DefaultTimeout(); 339await context.Response.BodyWriter.WriteAsync(sequence.First).DefaultTimeout(); 616await context.Response.BodyWriter.FlushAsync(); 708await context.Response.BodyWriter.FlushAsync(); 767await context.Response.BodyWriter.FlushAsync();
JwtBearerSample (2)
Startup.cs (2)
89Serialize(Todos, response.BodyWriter); 90await response.BodyWriter.FlushAsync();
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\JsonTranscodingServerCallContext.cs (1)
231return HttpContext.Response.BodyWriter.FlushAsync().GetAsTask();
Microsoft.AspNetCore.Http.Abstractions (3)
Extensions\HttpResponseWritingExtensions.cs (3)
61return response.BodyWriter.FlushAsync(cancellationToken).GetAsTask(); 68await response.BodyWriter.FlushAsync(cancellationToken); 74var pipeWriter = response.BodyWriter;
Microsoft.AspNetCore.Http.Extensions (10)
HttpResponseJsonExtensions.cs (10)
96return WriteAsJsonAsyncSlow(response.BodyWriter, value, options, response.HttpContext.RequestAborted); 99return JsonSerializer.SerializeAsync(response.BodyWriter, value, options, cancellationToken); 130return JsonSerializer.SerializeAsync(response.BodyWriter, value, jsonTypeInfo, cancellationToken); 137await JsonSerializer.SerializeAsync(response.BodyWriter, value, jsonTypeInfo, cancellationToken); 172return JsonSerializer.SerializeAsync(response.BodyWriter, value, jsonTypeInfo, cancellationToken); 179await JsonSerializer.SerializeAsync(response.BodyWriter, value, jsonTypeInfo, cancellationToken); 275return WriteAsJsonAsyncSlow(response.BodyWriter, value, type, options, 279return JsonSerializer.SerializeAsync(response.BodyWriter, value, type, options, cancellationToken); 326return WriteAsJsonAsyncSlow(response.BodyWriter, value, type, context, response.HttpContext.RequestAborted); 329return JsonSerializer.SerializeAsync(response.BodyWriter, value, type, context, cancellationToken);
Microsoft.AspNetCore.Http.Tests (1)
Internal\DefaultHttpResponseTests.cs (1)
63var bodyPipe = response.Response.BodyWriter;
Microsoft.AspNetCore.Mvc.Core (2)
Formatters\SystemTextJsonOutputFormatter.cs (1)
90var responseWriter = httpContext.Response.BodyWriter;
Infrastructure\SystemTextJsonResultExecutor.cs (1)
68var responseWriter = response.BodyWriter;
Microsoft.AspNetCore.Mvc.Formatters.Xml (1)
XmlSerializerOutputFormatter.cs (1)
254await fileBufferingWriteStream.DrainBufferAsync(response.BodyWriter);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
NewtonsoftJsonOutputFormatter.cs (1)
181await fileBufferingWriteStream.DrainBufferAsync(response.BodyWriter);
Microsoft.AspNetCore.OpenApi (2)
Extensions\OpenApiEndpointRouteBuilderExtensions.cs (2)
62await context.Response.BodyWriter.WriteAsync(output.ToArray(), context.RequestAborted); 63await context.Response.BodyWriter.FlushAsync(context.RequestAborted);
Microsoft.AspNetCore.OutputCaching.Tests (2)
TestUtils.cs (2)
86Encoding.UTF8.GetBytes(uniqueId, context.Response.BodyWriter); 87await context.Response.BodyWriter.FlushAsync();
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
189await body.CopyToAsync(response.BodyWriter, context.HttpContext.RequestAborted);
Microsoft.AspNetCore.ResponseCaching.Microbenchmarks (1)
ResponseCachingBenchmark.cs (1)
37await context.Response.BodyWriter.WriteAsync(new ReadOnlyMemory<byte>(_data, 0, Size));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
ResponseBodyTests.cs (2)
75var writer = httpContext.Response.BodyWriter; 95var writer = httpContext.Response.BodyWriter;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (6)
src\Servers\Kestrel\shared\test\TestApp.cs (6)
54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 57await response.BodyWriter.FlushAsync(); 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length); 75await response.BodyWriter.FlushAsync();
Microsoft.AspNetCore.TestHost.Tests (5)
ResponseBodyTests.cs (2)
21var writer = httpContext.Response.BodyWriter; 39var writer = httpContext.Response.BodyWriter;
TestClientTests.cs (3)
176await ctx.Response.BodyWriter.FlushAsync(); 274await ctx.Response.BodyWriter.FlushAsync(); 509await ctx.Response.BodyWriter.FlushAsync();
PlaintextApp (1)
Startup.cs (1)
32return response.BodyWriter.WriteAsync(payload).GetAsTask();
SignalRSamples (1)
Startup.cs (1)
55await using (var writer = new Utf8JsonWriter(context.Response.BodyWriter, _jsonWriterOptions))
Sockets.FunctionalTests (13)
src\Servers\Kestrel\shared\test\TestApp.cs (6)
54var memory = response.BodyWriter.GetMemory(buffer.Length); 56response.BodyWriter.Advance(buffer.Length); 57await response.BodyWriter.FlushAsync(); 72var memory = response.BodyWriter.GetMemory(bytes.Length); 74response.BodyWriter.Advance(bytes.Length); 75await response.BodyWriter.FlushAsync();
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (7)
65await context.Response.BodyWriter.WriteAsync(new Memory<byte>(bytes, 0, bytes.Length)); 309await context.Response.BodyWriter.WriteAsync(new Memory<byte>(scratchBuffer, 0, scratchBuffer.Length), context.RequestAborted); 535await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 673await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 888await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted); 966await context.Response.BodyWriter.FlushAsync(); 1052await context.Response.BodyWriter.WriteAsync(new Memory<byte>(chunkData, 0, chunkData.Length), context.RequestAborted);