代码
public class HomeController : Controller { public ActionResult Index() { return Content("hello", "text/plain"); } }
正在响应标题
Content-Type: text/plain; charset=utf-8
我的问题是如何从响应标头Content-Type中删除“; charset = utf-8”?
这里How do I remove the charset from Content-Type in a ASP.NET Core MVC response?是在asp.net核心上的操作方法。
代码公共类HomeController:控制器{public ActionResult Index(){return Content(“ hello”,“ text / plain”);用标题Content-Type响应:text / plain; ...
请尝试这个。