CURLOPT_PUT vs CURLOPT_POSTFIELDS CURLOPT_PUT vs CURLOPT_POSTFIELDS curl curl

CURLOPT_PUT vs CURLOPT_POSTFIELDS


If you look at the documentation, It says that when you set CURLOPT_PUT to truethen 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.