.Net Core post传值方式
$('#save').click(function () { var obj = { "Name": $('#txt_Name').val(), "JinE": $('#txt_JinE').val(), "ShouYi": $('#txt_ShouYi').val() }; $.ajax({ url: 'http://localhost:60054/product/insert', type: 'post', data: obj, dataType: 'json', contentType: 'application/x-www-form-urlencoded', accepts: "application/x-www-form-urlencoded", success: function (data) { if (data > 0) { alert("添加成功"); } else { alert("添加失败"); } } }); });