I am working on an ASP.NET Core app, however they don't seem to have ported the entire HttpRequest class into Microsoft.AspNetCore.Mvc. This method is missing:
https://msdn.microsoft.com/en-us/library/system.web.httprequest.binaryread(v=vs.90).aspx
Is there another way to do the same thing? I don't see a similar method to replace it.
You can use a MemoryStream on the Request and retrieve the content of the Body.
Something like:
using (var ms = new MemoryStream(2048))
{
await Request.Body.CopyToAsync(ms);
var rawData = ms.ToArray();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With