使用curl_setopt设置一个cURL传输选项时,不能以数组的形式传参,

可以:

header( "Content-type: application/octet-stream" );
curl_setopt($ch,CURLOPT_HTTPHEADER,["Content-type:application/octet-stream","Content-length: 100"]);

不能是键值对:

curl_setopt($ch,CURLOPT_HTTPHEADER,["Content-type"=>"application/octet-stream"]);