POST JSON DATA IS NULL
In my post http request,the json data is null,bad request 400,If I add code
app.Use(async (context, next) => { if (context.Request.Body.CanSeek) { context.Request.Body.Position = 0; } await next(); });
after app.UseExceptionless();
it worked,It should be the stream position is not reseted to 0 after reading
Thanks for reaching out! Our middleware should run last (if registered first) and should only read the post body if it's at position 0 or can be reset. One can also enable buffering: https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httprequestrewindextensions.enablebuffering?view=aspnetcore-9.0
If you can provide a sample or update our sample via a pr that reproduces we would be more than happy to dig into this further. Also are you suggesting that we reset it to what ever position it was at before we read it? If you could provide a use case and update this issue / sample that would be a massive help.
Please let me know if you have any questions
Also, make sure you define app.UseExceptionless as soon as possible in your Configure method.