求大神,关于HttpWebRequest接收不完数据的问题!
string reponse
byte[] data = this.encoder.GetBytes(request);
HttpWebRequest http = WebRequest.Create(url) as HttpWebRequest;
http.Timeout = 2000;
http.ContentType = "application/soap+xml; charset=utf-8";
http.ContentLength = data.Length;
http.Method = "POST";
using (Stream writer = http.GetRequestStream()) {
writer.Write(data, 0, data.Length);
}
using (WebResponse resp = http.GetResponse()) {
using (StreamReader reader = new StreamReader(resp.GetResponseStream(), this.encoder, false, (int)resp.ContentLength)) {
response = reader.ReadToEnd();
}
}