Custom QR Code with Logo

भुगतान किया गया
द्वारा qrcode-monkey | अपडेट किया गया hace 8 días | Tools
लोकप्रियता

9.8 / 10

लेटेंसी

668ms

सेवा का स्तर

98%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

working curl php method

Rapid account: Phenom Amd
PhenomAmd
hace 2 años

i have saw documentation but sadly couldnt find a working example of uploading img with phpcurl perhaps this will help people

$url = ' ';//set your api endpoint here

 $file = ' '; // set your filename here
 
 $headers = array(
    "X-RapidAPI-Host: setyourapihosthere",//<---
    "X-RapidAPI-Key: setyourapikeyhere",// <---
 );
 
 $curl = curl_init($url);

curl_setopt($curl, CURLOPT_URL, $url);
 
 curl_setopt($curl, CURLOPT_POST, true);
 
 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
 
 curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
 
 $fields = [
     'file' => new \CurlFile($file, 'image/png', 'file.png')
 ];
 curl_setopt($curl, CURLOPT_POSTFIELDS, $fields);
 
 $resp = curl_exec($curl);
 curl_close($curl);
 
 $obj = json_decode($resp);
 
 $logo = $obj->file; <---- use var $logo for your generating code  

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें