C# HttpWebRequest 错误总结

时间:2023-12-20 11:41:56

1、form data 需要编码!!!

        byte[] data = new ASCIIEncoding().GetBytes("pattern=0&wwid=古兴越&goodid=&page=1");//没有编码 查不到数据
request.ContentLength = data.Length;//ContentLength
Stream newStream = request.GetRequestStream();
newStream.Write(data, , data.Length);
newStream.Close();