curl -kvs -X POST https://xxxx-xxxx.azure-api.net/*******/reports -k -H "account: ********" -H "Ocp-Apim-Subscription-Key: ***********"
on making this curl, i'm getting the error message as HTTP/1.1 411 Length Required. I know we can fix this by adding the content -length header to the curl. But can we do something from azure apim level to get it fixed?
Thanks in Advance.
As per the HTTP 1.1 protocol the request made SHOULD have the Content-Length header supplied when a HTTP request is made to an endpoint. Following is the extract from the standard
An example is
This header is used as a part of the logic to determine the length of the message. This logic is explained in the section 4.4 of the RFC 2616. You can read about it at RFC 2616 Section 4.4 Message Length
If you have used an API testing tool like POSTMAN, you will see that it automatically adds the header to request that you send. Same is the case with Azure API Management developer portal, if you inspect the network traffic originating from the portal, you would see the content-length added to the request.
In a nutshell, you should not avoid sending the
Content-Length
header.