When using the api, I get this error ? what im i doing wrong ?
Heres my code
$filename = $_FILES['pdf']['tmp_name']; if(!is_readable($filename)){ print('ERROR: file does not exist or is not readalbe'); return; } $curl = curl_init(); $cfile = curl_file_create($filename, 'application/pdf'); curl_setopt_array($curl, array( CURLOPT_URL => "https://cameleonpdf.p.rapidapi.com/pdf2html/.", CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => array('PDF' => $cfile), CURLOPT_HTTPHEADER => array( "content-type: application/pdf", "x-rapidapi-host: cameleonpdf.p.rapidapi.com", "x-rapidapi-key: MY_KEY_API" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
Hi, I tested it right now. On my side, api is working… How did you call the api? Thank you.
BR Leon
加入讨论 - 在下面添加评论:
Heres my code
Hi, I tested it right now.
On my side, api is working…
How did you call the api?
Thank you.
BR
Leon