测试go结构, 同事模拟curl 一直过不去
测试可行的代码
<?php $ch = curl_init(); $path = dirname(__FILE__)."/404.jpg"; $post_data = array( 'path'=>'accessory20200310170042', 'rename'=>'1', 'path_type'=>'0', 'files[]'=>new CURLFile($path) ); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch,CURLOPT_BINARYTRANSFER,true); curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data); curl_setopt($ch, CURLOPT_URL, 'http://localhost:3001/upload/files?app_id=xxxx×tamp=1111&token=22222'); $info= curl_exec($ch); curl_close($ch); print_r($info); ?>
0则评论给“PHPcurl 模拟 form表单提交”