Witam, piszę API i mam problem z wyświetleniem PDFa, oczywiście nie chce pokazywać linku:
$url = "url";
$postfields["apiuser"] = "apiuser";
$postfields["secretkey"] = "secterkey";
$postfields["rdtype"]="json";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 200);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt
($ch, CURLOPT_HTTPHEADER
, array("Expect:")); curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
return json_decode($data);
Jak zwrócić obiekt PDF, żeby się od razu pobrał?