PHP CURL: HTTP/1.1 411 Length Required PHP CURL: HTTP/1.1 411 Length Required curl curl

PHP CURL: HTTP/1.1 411 Length Required


Are you sure you need to be using the NTLM authentication option?

curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);

I tested with this and it causes the content-type header as well as the JSON payload to be omitted from the request.

Try removing that line and see the request works.


You set Content-length to the length of $data, but you post $update_json instead $data


I had, sort of, the same problem and was breaking my brains on it for a couple of hours.Just remove the content-length from the header:

like this

curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json;charset=utf-8"))