[HttpGet] [Route("api/test")] public HttpResponseMessage Test() { string res= "hello world"; return new HttpResponseMessage { Content = new StringContent(res, System.Text.Encoding.UTF8, "text/plain") }; }
.net webapi返回content-type指定为text/plain
王递杰 2021年6月5日 .Net
评论
评论插件
Powered by .NET Core