Here is solution :
System.Net.ServicePointManager
class has a static property named Expect100Continue
. Setting this to false will stop the header "Expect: 100-Continue" from being sent.You may see code snippet below about how to implement it.
// create web request
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create("http://something");
webRequest.Method = "POST";
webRequest.ServicePoint.Expect100Continue = false;
// post data
requestStream = webRequest.GetRequestStream();
StreamWriter requestWriter = new StreamWriter(requestStream);
requestWriter.Write(dataToPost);
requestWriter.Close();
//wait for server response
HttpWebResponse response = (HttpWebResponse) webRequest.GetResponse();
0 nhận xét:
Post a Comment