HTTP 411 Length Required means the server refuses to accept the request because the Content-Length header is missing. The server needs to know the size of the request body before processing it.
The client is sending a request body without specifying its length, and the server requires it.
Include the Content-Length header with the exact byte size of the request body.
curl -v -X POST -H 'Content-Length: 13' -d '{"key":"val"}' https://api.example.com/If the request size is unknown upfront, check if the server supports Transfer-Encoding: chunked as an alternative.