Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure is forcing client to send HTTP Expect 100 Continue with large data requests

I have an Azure Cloud Service with WorkerRole that accepts https requests.

IT seems that Azure magic is forcing client to send Expect 100 Continue in an https request header if the payload is > 50KB.

If you send request with data less than 50KB to an Azure https endpoint the server returns the response otherwise the request is timed-out. If Expect 100 Continue is added to the request which is > 50KB the request is accepted.

Any idea why and how to disable this feature?

like image 856
Dan Dinu Avatar asked Jan 19 '26 07:01

Dan Dinu


1 Answers

It's actually the client that is in control of this. Your client implementation must be sending an HTTP header like so:

Expect: 100-continue

Otherwise the server wouldn't bother replying with a 100 Continue status.

If you do not want to use this feature of HTTP/1.1 then simply stop sending the header from your client. In .NET it's turned on by default and you can turn it off for all HttpWebRequests within an AppDomain using this static property:

 ServicePointManager.Expect100Continue = false;
like image 144
Drew Marsh Avatar answered Jan 20 '26 23:01

Drew Marsh