.net webapi返回content-type指定为text/plain
王递杰 2021年6月5日 .Net
[HttpGet]
[Route("api/test")]
public HttpResponseMessage Test()
{
string res= "hello world";
return new HttpResponseMessage { Content = new StringContent(res, System.Text.Encoding.UTF8, "text/plain") };
}
相关博客
评论
暂无评论
随笔分类
Powered by .NET 6.0 陕ICP备2020018176号-4