是否有适用于PHP的CURL模拟器?我的主机没有启用CURL。我寻找一些与CURL具有相同命令的PHP等价物。你知道这样的解决方案吗?或者我必须更改代码?如何使用没有CURL的文件上传进行POST API调用?
我需要这个等价物:
$file_name_with_full_path = dirname(__FILE__) . "/temp/" . $sFileName;
$post = array( 'ApiKey' => '6548dcsdf'
,'File' => '@'.$file_name_with_full_path
,'WorksheetIndex' => 1
,'WorksheetActive' => 'True'
,'WorksheetName' => 'Rechnung'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://do.convertapi.com/Excel2Pdf");
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);
$result = curl_exec( $ch );
curl_close( $ch );
答案 0 :(得分:0)