webapi net 直接更改协议头

1.直接更改协议头

[HttpGet]
        public HttpResponseMessage Users()
        {
            var sites = new object();
            string str = tools_json.ObjToJson(sites);
            HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "text/html") };
            return result;
        }

 

posted @ 2016-11-03 15:12  点点_滴滴  阅读(351)  评论(0编辑  收藏  举报