When using JS to send a request, the form is generally used. JSON object or string
$.post (URL,JSONSTR)
Server-side Get parameters
Request.QueryString.Get ();//Get parameter
Request.Form.Get ();//Post Parameters
Since has been the use of JS to send a request, did not pay attention to the server is not receiving parameters of the situation
When you use C # 's HttpWebRequest to send HTTP requests, you find that the server does not receive parameters. (appears when using post mode)
So use the most method, read InputStream, can get parameters
byte[] Byts = new Byte[this. Request.InputStream.Length];
Request.InputStream.Read (Byts, 0, Byts. Length);
JSON = System.Text.Encoding.Default.GetString (Byts);
If you want the server to get the form parameter Request.Form.Get () for the post, then pass the parameters as follows
String postpara="id=1&name=xx";//The same as the Parameter form on the URL
byte[] data = System.Text.Encoding.UTF8.GetBytes (Postpara);
Request. ContentLength = data. Length;
Reqstream = Request. GetRequestStream ();
Reqstream.write (data, 0, data. Length);
Reqstream.close ();
HttpWebRequest Send HTTP Parameters