WebApi中直接返回json字符串的方法

时间:2014-06-18 14:05:36   收藏:0   阅读:263
[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

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!