WebAPI如何返回json
public HttpResponseMessage PostUser(User user) { JavaScriptSerializer serializer = new JavaScriptSerializer(); string str = serializer.Serialize(user); HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json") }; return result; }