I want to get Http Request body in .net core , I used this code:
using (var reader
= new StreamReader(req.Body, Encoding.UTF8))
{
bodyStr = reader.ReadToEnd();
}
req.Body.Position = 0
But I got this error:
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'FileBufferingReadStream'.
An error occurs after the using statement of the line
How to get HttpRequest Body in .net core? and how to fix this error?