Category : curl

<?php error_reporting(E_ALL); echo "faseeh"; $paymentref = $_GET["ref"]; echo $paymentref; // api key $apikey = ""; $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, "https://api-gateway.sandbox.ngenius-payments.com/identity/auth/access-token"); curl_setopt($ch, CURLOPT_URL, "https://api-gateway.ngenius-payments.com/identity/auth/access-token"); curl_setopt($ch, CURLOPT_HTTPHEADER, array( // "accept: application/vnd.ni-identity.v1+json", "authorization: Basic ".$apikey, "content-type: application/vnd.ni-identity.v1+json" )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); // curl_setopt($ch, CURLOPT_POSTFIELDS, "{"realmName":"ni"}"); $output = json_decode(curl_exec($ch)); // echo "<pre>"; // print_r($output); ..

Read more

I am uploading file from local server to Azure storage – blob container using Simple PHP cURL function. I taken code from below url . https://stackoverflow.com/questions/41682393/simple-php-curl-file-upload-to-azure-storage-blob Can someone tell me any link or code which I can download file from Azure storage – blob without any SDK and/or multiple files/libraries. It should be like a ..

Read more

I am using XAMP server. I downloaded cacert.pem file and I placed it in the path C:xamppphpextrasssl . I tried to give path for curl.cainfo in php.ini file. But it is already setted as curl.cainfo="C:xamppapachebincurl-ca-bundle.crt" . I tried romoving that path and replaced with C:xamppphpextrassslcacert.pem. But still now it is not working. Now what should ..

Read more

I’m trying to send a file with php cURL but I have some issues with the content type This is the original example provided by our partner: curl -u "auth" "www.upload_url.com" -H ‘Content-Type:image/jpeg’ -X POST –data-binary @image.jpg Which I translated to this: $photo = ‘image.jpg’; $call = ‘www.upload_url.com’; $file = curl_file_create(realpath($photo),mime_content_type(realpath($photo)),’file’); $headers = array( ‘Content-Type: ..

Read more

I’m trying to make an API request between two laravel websites. For the first website, this is how it’s structured. api.php use IlluminateSupportFacadesRoute; Route::group([‘prefix’ => ‘v1’], function () { Route::get(‘getCountries’, ‘[email protected]’); }); ApiController public function getCountries() { $country = Country::get(); $country->makeHidden([‘flag’]); //svg return $country; } This returns on postman using GET https://website.com/api/v1/getCountries: [{"id":1,"iso":"AF","name":"AFGHANISTAN","nicename":"Afghanistan","iso3":"AFG","numcode":4,"phonecode":93,"created_at":null,"updated_at":null},{"id":2,"iso":"AL","name":"ALBANIA","nicename":"Albania","iso3":"ALB","numcode":8,"phonecode":355,"created_at":null,"updated_at":null},{"id":3,"iso":"DZ","name":"ALGERIA","nicename":"Algeria","iso3":"DZA","numcode":12,"phonecode":213,"created_at":null,"updated_at":null},{"id":4,"iso":"AS","name":"AMERICAN SAMOA","nicename":"American Samoa","iso3":"ASM","numcode":16,"phonecode":1684,"created_at":null,"updated_at":null},{"id":5,"iso":"AD","name":"ANDORRA","nicename":" ..

Read more