fork download
  1. <?php
  2. $curl = curl_init();
  3. CURLOPT_URL => "https://d...content-available-to-author-only...z.com/api/voucher/verify",
  4. CURLOPT_RETURNTRANSFER => true,
  5. CURLOPT_POST => true,
  6. CURLOPT_POSTFIELDS => json_encode([
  7. 'voucher_code' => 'ABC123'
  8. ]),
  9. CURLOPT_HTTPHEADER => [
  10. "Content-Type: application/json",
  11. "X-API-KEY: nuaOgTF5ZGS9krJMAlDklUqmfFoSd1efkA7Z38QQmyQJbRVJBAvPyeAbAmUw1M9x"
  12. ],
  13. ]);
  14. $response = curl_exec($curl);
  15. $voucher_data = json_decode($response, true);
  16.  
  17. print_r($voucher_data);
  18. ?>
  19.  
Success #stdin #stdout 0.03s 26148KB
stdin
Standard input is empty
stdout
Standard output is empty