1 override of BodyReader
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpRequest.cs (1)
172public override PipeReader BodyReader
112 references to BodyReader
Aspire.Dashboard (3)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (3)
184result = await httpContext.Request.BodyReader.ReadAsync().ConfigureAwait(false); 205httpContext.Request.BodyReader.AdvanceTo(result.Buffer.Start, result.Buffer.End); 215httpContext.Request.BodyReader.AdvanceTo(result.Buffer.End);
InMemory.FunctionalTests (91)
ChunkedRequestTests.cs (18)
45var readResult = await request.BodyReader.ReadAsync(); 53request.BodyReader.AdvanceTo(readResult.Buffer.End); 389var result = await request.BodyReader.ReadAsync(); 390request.BodyReader.AdvanceTo(result.Buffer.End); 918var readResult = await request.BodyReader.ReadAsync(); 919request.BodyReader.AdvanceTo(readResult.Buffer.End); 921var requestTask = httpContext.Request.BodyReader.ReadAsync(); 923httpContext.Request.BodyReader.CancelPendingRead(); 974var readResult = await request.BodyReader.ReadAsync(); 975request.BodyReader.AdvanceTo(readResult.Buffer.End); 977httpContext.Request.BodyReader.Complete(); 979await Assert.ThrowsAsync<InvalidOperationException>(async () => await request.BodyReader.ReadAsync()); 1024var readResult = await request.BodyReader.ReadAsync(); 1025request.BodyReader.AdvanceTo(readResult.Buffer.End); 1027request.BodyReader.Complete(); 1087var readResult = await request.BodyReader.ReadAsync(); 1088request.BodyReader.AdvanceTo(readResult.Buffer.End); 1090httpContext.Request.BodyReader.Complete(new Exception());
Http2\Http2ConnectionTests.cs (8)
1387var readResult = await context.Request.BodyReader.ReadAsync(); 1390context.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1391readResult = await context.Request.BodyReader.ReadAsync(); 1394context.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1396readResult = await context.Request.BodyReader.ReadAsync(); 1401context.Request.BodyReader.AdvanceTo(readResult.Buffer.End); 5660var result = await context.Request.BodyReader.ReadAsync().DefaultTimeout(); 5663context.Request.BodyReader.AdvanceTo(result.Buffer.Start, result.Buffer.End);
Http2\Http2StreamTests.cs (17)
189return context.Request.BodyReader.CopyToAsync(context.Response.BodyWriter); 240return context.Request.BodyReader.CopyToAsync(context.Response.BodyWriter); 998var readResult = await context.Request.BodyReader.ReadAsync(); 1001context.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1002readResult = await context.Request.BodyReader.ReadAsync(); 1006context.Request.BodyReader.AdvanceTo(readResult.Buffer.End); 1042var readResult = await context.Request.BodyReader.ReadAsync(); 1044context.Request.BodyReader.AdvanceTo(readResult.Buffer.End); 1281var readResult = await context.Request.BodyReader.ReadAsync(); 1284context.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1285readResult = await context.Request.BodyReader.ReadAsync(); 1289context.Request.BodyReader.AdvanceTo(readResult.Buffer.End); 1291readResult = await context.Request.BodyReader.ReadAsync(); 5527var requestBodyTask = context.Request.BodyReader.ReadAsync(); 5546await Assert.ThrowsAsync<ConnectionAbortedException>(async () => await context.Request.BodyReader.ReadAsync()); 5693var requestBodyTask = context.Request.BodyReader.ReadAsync(); 5714await Assert.ThrowsAsync<ConnectionAbortedException>(async () => await context.Request.BodyReader.ReadAsync());
Http3\Http3StreamTests.cs (8)
622var readResult = await context.Request.BodyReader.ReadAsync(); 625context.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 626readResult = await context.Request.BodyReader.ReadAsync(); 630context.Request.BodyReader.AdvanceTo(readResult.Buffer.End); 1769var requestBodyTask = context.Request.BodyReader.ReadAsync(); 1788await Assert.ThrowsAsync<ConnectionAbortedException>(async () => await context.Request.BodyReader.ReadAsync()); 1896var requestBodyTask = context.Request.BodyReader.ReadAsync(); 1917await Assert.ThrowsAsync<ConnectionAbortedException>(async () => await context.Request.BodyReader.ReadAsync());
KestrelMetricsTests.cs (1)
173var result = await context.Request.BodyReader.ReadAsync();
RequestTests.cs (39)
96var data = await context.Request.BodyReader.ReadAsync(); 970var readResult = await httpContext.Request.BodyReader.ReadAsync().AsTask().DefaultTimeout(); 1017var readResult = await httpContext.Request.BodyReader.ReadAsync(); 1020httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.End); 1049var readResult = await httpContext.Request.BodyReader.ReadAsync(); 1052httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1053readResult = await httpContext.Request.BodyReader.ReadAsync(); 1055httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1084var readResult = await httpContext.Request.BodyReader.ReadAsync(); 1087httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1091readResult = await httpContext.Request.BodyReader.ReadAsync(); 1093httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1127await httpContext.Request.BodyReader.CopyToAsync(ms1); 1128await httpContext.Request.BodyReader.CopyToAsync(ms2); 1184var readResult = await ReadAtLeastAsync(httpContext.Request.BodyReader, numBytes: 3); 1188httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1191readResult = await httpContext.Request.BodyReader.ReadAsync(); 1192httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1196readResult = await httpContext.Request.BodyReader.ReadAsync(); 1200httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1201readResult = await httpContext.Request.BodyReader.ReadAsync(); 1238var readResult = await httpContext.Request.BodyReader.ReadAsync(); 1240httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Start, readResult.Buffer.End); 1242readResult = await httpContext.Request.BodyReader.ReadAsync(); 1243httpContext.Request.BodyReader.AdvanceTo(readResult.Buffer.Slice(1).Start, readResult.Buffer.End); 1910var readResult = await request.BodyReader.ReadAsync(); 1911request.BodyReader.AdvanceTo(readResult.Buffer.End); 1913var requestTask = httpContext.Request.BodyReader.ReadAsync(); 1915httpContext.Request.BodyReader.CancelPendingRead(); 1960var readResult = await request.BodyReader.ReadAsync(); 1961request.BodyReader.AdvanceTo(readResult.Buffer.End); 1963httpContext.Request.BodyReader.Complete(); 1965await Assert.ThrowsAsync<InvalidOperationException>(async () => await request.BodyReader.ReadAsync()); 2002var readResult = await request.BodyReader.ReadAsync(); 2003request.BodyReader.AdvanceTo(readResult.Buffer.End); 2005httpContext.Request.BodyReader.Complete(); 2045var readResult = await request.BodyReader.ReadAsync(); 2046request.BodyReader.AdvanceTo(readResult.Buffer.End); 2048httpContext.Request.BodyReader.Complete(new Exception());
Interop.FunctionalTests (5)
Http3\Http3RequestTests.cs (1)
1353await context.Request.BodyReader.ReadAtLeastAsync(TestData.Length);
HttpClientHttp2InteropTests.cs (4)
81await context.Request.BodyReader.CopyToAsync(context.Response.BodyWriter).DefaultTimeout(); 167await context.Request.BodyReader.CopyToAsync(context.Response.BodyWriter).DefaultTimeout(); 269var reader = context.Request.BodyReader; 328var reader = context.Request.BodyReader;
Microsoft.AspNetCore.Http (1)
Features\FormFeature.cs (1)
215var formReader = new FormPipeReader(_request.BodyReader, encoding)
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactory.cs (1)
101private static readonly MemberExpression RequestPipeReaderExpr = Expression.Property(HttpRequestExpr, typeof(HttpRequest).GetProperty(nameof(HttpRequest.BodyReader))!);
Microsoft.AspNetCore.Http.Extensions.Tests (10)
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBody.cs (10)
249var result = await httpContext.Request.BodyReader.ReadAsync(); 252httpContext.Request.BodyReader.AdvanceTo(result.Buffer.End); 290var result = await httpContext.Request.BodyReader.ReadAsync(); 293httpContext.Request.BodyReader.AdvanceTo(result.Buffer.End); 325Assert.Same(httpContext.Request.BodyReader, pipeReader); 331var result = await httpContext.Request.BodyReader.ReadAsync(); 334httpContext.Request.BodyReader.AdvanceTo(result.Buffer.End); 366Assert.Same(httpContext.Request.BodyReader, pipeReader); 372var result = await httpContext.Request.BodyReader.ReadAsync(); 375httpContext.Request.BodyReader.AdvanceTo(result.Buffer.End);
Microsoft.AspNetCore.Http.Tests (1)
Internal\DefaultHttpRequestTests.cs (1)
246var bodyPipe = context.Request.BodyReader;