Expect: 100-continue Header Problem

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.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Tuesday, April 28, 2009 11:13 PM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910