[HttpGet]
public HttpResponseMessage GetStuInfo()
{
string strJson = "{\"UserName\":\"张三\",\"Age\":\"14\",\"Gender\":\"男\"}";
return new HttpResponseMessage { Content = new StringContent(strJson , System.Text.Encoding.UTF8, "application/json") };
}
WebApi直接返回json字符串的方法
最新推荐文章于 2024-06-20 16:33:22 发布