第一步:把对象转JSON字符格式
var jsonStringify = JSON.stringify({})
第二步:POST提交
$.post("/api/notify_url.aspx", jsonStringify, function (res) {
}, "json");
第三步:.NET后台接收数据
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/x-www-form-urlencoded";
StreamReader reader = new StreamReader(Request.InputStream);
string stream = reader.ReadToEnd();
notifyjson json = new JavaScriptSerializer().Deserialize<notifyjson>(stream);
}
"唯有高屋建瓴,方可水到渠成"