.NET-Core中 HttpContext.Response.Write() 中文输出乱码
[删除(380066935@qq.com或微信通知)]
app.Use((context, next) =>
{
var res = next(context);
if (context.Response.StatusCode == 404)
{
context.Response.StatusCode = 200;
context.Response.ContentType = "text/plain; charset=utf-8";
context.Response.Body.WriteAsync(Encoding.UTF8.GetBytes("访问页面不存在,若要继续访问,请返回主页,谢谢!!"));
}
return res;
});