由于rest api使用多表单,所以我尝试使用curl发布一个文件。
这是我目前所拥有的。
$curlFile = new \CURLFile("shirt.png");
$data = array
(
"apikey" => $key,
"isTgaUploadEnabled" => "True",
"onVerificationPage" => "False",
"file" => $curlFile,
);
curl_setopt_array($curl, array(
CURLOPT_HEADER => TRUE,
CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_POSTFIELDS => $data,
));
使用CURLFile类不能工作,有什么建议吗?
https://stackoverflow.com/questions/52137542
复制相似问题