No Clean Feed - Stop Internet Censorship in Australia

HTTP 417 error when POSTing to Lighttpd

We just shifted from using HTTP GET to HTTP POST for some of our web services; in this case, we are POSTing from a .NET 2.0 application to a Ruby on Rails server running on Lighttpd (a.k.a. lighty).

This resulted in an HTTP 417 error.

This is caused by the Microsoft .NET WebClient class adding an expect header into the POST, which in turn causes Lighttpd 1.4 to fail. The fix (as explained by Phil Haack) is to make the following call before POSTing:

System.Net.ServicePointManager.Expect100Continue = false;