HttpWebRequest - the 6 million dollar question

  • Thread starter Thread starter furty
  • Start date Start date
F

furty

I'm posting this again as it's been 1 week now and still not a single reply,
surely someone must have come across this problem!

I've hit a brick wall with this one..

I'm trying to perform a HttpWebRequest that posts form data to the target
server - the problem is that the request *always* contains an Expect:
100-continue header, which on HTTP 1.0 servers results in a 500 error.

None of these seemingly obvious fixes work:

Set the HttpWebRequest.Expect property to null or String.Empty
Set the HttpWebRequest.ProtocolVersion to HttpVersion.Version10

Note that my class works perfectly with HTTP 1.1 servers, so I doubt there's
anything I've done incorrectly in code. Also note that the problem only
surfaces when you POST data to the server with the request, no post data =
no problem.

Searching google for this problem has given me a few people that have hit
the same problem, but not one valid workaround.

Help!
 
Which version of the framework are you on ? If it is Version1, then install
SP2, plus latest QFEs. There is a QFE which fixes this problem by exposing a
"Expect100Continue" prooperty on the webrequest. I dont remember the QFE
number offhand, but if you search on support.microsoft.com, you will find
it.
 
Hi feroze,

I have tried my code on framework 1.0 and 1.1, the same issue seems to exist
in all framework versions. I have tried setting the Expect property to null
and String.Empty and can confirm it has no effect on the expect header when
POSTing data with a request.
 
Back
Top