标签:style type code cat test for stream input bsp
js
var xhr = new XMLHttpRequest(); xhr.open("post", "/Home/NoParamTest", true); //两种协议都可以 xhr.setRequestHeader("Content-Type", "application/json"); //xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send(JSON.stringify({ a: 1, b: 2, c: 3 }));
c#后台
public void NoParamTest() { using (StreamReader sr = new StreamReader(Request.InputStream)) {
//data就是前面传过来的数据 string data = sr.ReadLine(); } }
标签:style type code cat test for stream input bsp
原文地址:http://www.cnblogs.com/myesn/p/6030507.html