ASP.NET Core Response.Body is by default an HttpResponseStream, which is characterized by allowing writes only in append mode, and it cannot be read or modified. Therefore, the fundamental method is to replace the HttpResponseStream. You can set up a middlewar…

