CURLOPT_PUT vs CURLOPT_POSTFIELDS
If you look at the documentation, It says that when you set CURLOPT_PUT
to true
then the file to PUT
must be set with CURLOPT_INFILE
and CURLOPT_INFILESIZE
(In your case you are not setting the file).
Setting CURLOPT_CUSTOMREQUEST
to PUT
method is not expecting the file which is the main difference between CURLOPT_CUSTOMREQUEST
and CURLOPT_PUT
.