[HttpPost] public HttpResponseMessage Upload() { string json = "{\"result\":\"true\"}"; return new HttpResponseMessage { Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json") }; }
WebApi中直接返回json字符串的方法,布布扣,bubuko.com
原文:http://www.cnblogs.com/yeagen/p/3791506.html