Bootstrap FreeKB - Curl - Resolve "HTTP Error 411 The request must be chunked or have a content length"
Curl - Resolve "HTTP Error 411 The request must be chunked or have a content length"

Updated:   |  Curl articles

Let's say something like this is being return when issuing a curl command.

HTTP Error 411. The request must be chunked or have a content length.

 

This means the API expects the Content-Length header. Typically, this error can be resolved by including --header "Content-Length: 0".

curl --request POST --header "Content-Length: 0" --url https://api.example.com/api/v1 --data '{ "foo": "bar" }'

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


May 01 2023 by chandra
thank you so much brother , it helped me to solve the issue , god bless you

Add a Comment


Please enter 100148 in the box below so that we can be sure you are a human.