src/packages/EmbedIO/HttpContextExtensions-Requests.cs
/// <summary>
/// Asynchronously retrieves the request body as an array of <see langword="byte"/>s.
/// </summary>
/// <param name="this">The <see cref="IHttpContext"/> on which this method is called.</param>
/// <returns>A <see cref="Task{TResult}">Task</see>, representing the ongoing operation,
/// whose result will be an array of <see cref="byte"/>s containing the request body.</returns>
/// <exception cref="NullReferenceException"><paramref name="this"/> is <see langword="null"/>.</exception>
Asynchronously retrieves the request body as an array of s.
Asynchronously retrieves the request body as an array of s .
public static async Task<byte[]> GetRequestBodyAsByteArrayAsync(this IHttpContext @this)
        {
            using var buffer = new MemoryStream();
            using var stream = @this.OpenRequestStream();
            await stream.CopyToAsync(buffer, WebServer.StreamCopyBufferSize, @this.CancellationToken).ConfigureAwait(false);
            return buffer.ToArray();
        }
public static async Task < byte [ ] > GetRequestBodyAsByteArrayAsync ( this IHttpContext @this ) { using var buffer = new MemoryStream ( ) ; using var stream = @this . OpenRequestStream ( ) ; await stream . CopyToAsync ( buffer , WebServer . StreamCopyBufferSize , @this . CancellationToken ) . ConfigureAwait ( false ) ; return buffer . ToArray ( ) ; }
Asynchronously retrieves the request body as an array of s.
Asynchronously retrieves the request body as an array of s .
A Tasks containing the request body.
A Tasks containing the request body .
None
IHttpContext
this
this
The  on which this method is called.
The on which this method is called .