62,253
社区成员
发帖
与我相关
我的任务
分享/// <summary>
/// 这是一个方法
/// </summary>
/// <param name="model">这是一个model</param>
/// <returns></returns>
[HttpPost]
public Response<string> PostListModel([FromBody]List<model> list)
{
} var postdata = '[{"ID":1,"mobile":214,"Name":"ff%d","Phone":"5255","CreateDate":"","MID":-1}]';
$.ajax({
type: 'POST',
contentType: "application/json; charset=urf-8",
url: 'http://localhost:50750/api/test/PostListModel',
//data: JSON.stringify(postdata),
data: postdata,
dataType: 'json',
success: function (result) { alert(result); },
error: function (e) { alert(e); } });var postdata = {“ID":1,"mobile":214,"Name":"ff%d","Phone":"5255","CreateDate":"","MID":-1};var postdata = {'':[你的json]}
public HttpResponseMessage Post(HttpRequestMessage req)
{
var content = req.Content.ReadAsStringAsync().Result;
}
看看他们到底传了啥进来