标签:
api
[HttpPost] public string PostAvartos(Test model) { if (model != null) { LoggerHelper.WriteInfo(model.id + " " + model.name); } else { LoggerHelper.WriteInfo("error"); } return ""; }
实体类
public class Test { public int id { get; set; } public string name { get; set; } }
前端post
$.ajax({ url: "/api/PostAvartos", type: "post", data: {id:1,name:‘2‘}, contentType: "application/json" });
标签:
原文地址:http://www.cnblogs.com/xcsn/p/4449101.html