我正在尝试发布大量内容,大约13000个字符。但我一直在进行手术。更改超时没有用,因为它需要很长时间。 这是我的代码
string textToSpin = rtbOri.Text; //13000 Characters
string post_data = "api_key=" + api_key + "&article=" + HttpUtility.UrlEncode(textToSpin) + "&lang=" + lang;
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create(serviceUri);
request.Credentials = new NetworkCredential("userName", "password");
request.Method = "POST";
request.Timeout = Timeout.Infinite;
byte[] postBytes = Encoding.ASCII.GetBytes(post_data);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = postBytes.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string reader = new StreamReader(response.GetResponseStream()).ReadToEnd();
rtbSpin.AppendText(reader);
有什么想法吗?感谢