CodeIgniter Forums
How rewite this - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: How rewite this (/showthread.php?tid=92231)



How rewite this - motoroller - 12-26-2024

$file = @fopen($localFilePath, 'w');
                $ch = curl_init($FileDetails['href']);
                curl_setopt($ch, CURLOPT_FILE, $file);
                curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: OAuth ']);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                curl_setopt($ch, CURLOPT_HEADER, false);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
                fwrite($file, curl_exec($ch));
                curl_close($ch);
                fclose($file);


how can i rewite this with  Services::curlrequest

i have a lot custum options is it possible or not?

And one more question how send CURLOPT_RETURNTRANSFER to true when i get quest via curlrequest i have headers

And i get image and insede body included headers, how can i remove it?