测试
#region 测试 [HttpPost] public HttpResponseMessage UserData(int userId, string userName) { var user = new { id = "id_" + userId, name = "name_" + userName }; var result = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(user), System.Text.Encoding.GetEncoding("UTF-8"), "application/json") }; return result; } #endregion