string postdata = "authcode=**&username=007&userpwd=007";
byte[] post = Encoding.GetEncoding(936).GetBytes(postdata);
HttpWebRequest myres = (HttpWebRequest)HttpWebRequest.Create("http://www.***.com/adduser"); myres.Method = "POST";
myres.ContentLength = post.Length;
myres.ContentType = "application/x-www-form-urlencoded"; Stream mystream = myres.GetRequestStream(); mystream.Write(post, 0, post.Length); HttpWebResponse myreq = (HttpWebResponse) myres.GetResponse();
StreamReader reader = new StreamReader(myreq.GetResponseStream(), Encoding.UTF8);
Response.Write(reader.ReadToEnd());
为什么他那边收到的参数都是空呢?
byte[] post = Encoding.GetEncoding(936).GetBytes(postdata);
HttpWebRequest myres = (HttpWebRequest)HttpWebRequest.Create("http://www.***.com/adduser"); myres.Method = "POST";
myres.ContentLength = post.Length;
myres.ContentType = "application/x-www-form-urlencoded"; Stream mystream = myres.GetRequestStream(); mystream.Write(post, 0, post.Length); HttpWebResponse myreq = (HttpWebResponse) myres.GetResponse();
StreamReader reader = new StreamReader(myreq.GetResponseStream(), Encoding.UTF8);
Response.Write(reader.ReadToEnd());
为什么他那边收到的参数都是空呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货