411 content length required on IIS server but not on linux based server

817 Views Asked by At

I have a RESTApi application which I have recently moved over to Microsoft Azure App-services. Earlier it was hosted on a Linux server. The issue that I am seeing is weird:

  1. When a client using ASP.net call a POST request with no body and no content-length header explicitly passed, the request fails with 411 Content-length required error. For the same client, the requests which were going on to the Linux server are still working fine.

  2. For a client using python/PHP, the same request works on both the IIS and Linux environments.

I am unable to understand why this might be happening. I have resolved the issue by sending content-length:0 for this API call but want to understand why this is happening.

0

There are 0 best solutions below