Here is a way for you to disable the
Expect: 100-continue Header:
string url = "http://www.myurl.com";
ServicePoint sp = ServicePointManager.FindServicePoint(new Uri(url));
sp.Expect100Continue = false;
I was getting a 500 http error when I tried to send a post to a Java web service through .Net using HttpWebRequest. Turning off this header did the trick. This will work even if you are using the WebClient class, which goes through HttpWebRequest under the covers. Hope this helps someone, this is a doozy of a problem to debug.
posted @ Tuesday, April 28, 2009 11:13 PM