fork download
  1. <?php
  2.  
  3. $curl = curl_init();
  4.  
  5. CURLOPT_URL => "https://a...content-available-to-author-only...s.ai/v2/client/offers",
  6. CURLOPT_RETURNTRANSFER => true,
  7. CURLOPT_ENCODING => "",
  8. CURLOPT_MAXREDIRS => 10,
  9. CURLOPT_TIMEOUT => 30,
  10. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  11. CURLOPT_CUSTOMREQUEST => "GET",
  12. CURLOPT_HTTPHEADER => [
  13. "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (HTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
  14. "X-Api-Token: ca4bc98f-1c8b-4e8d-81ac-377f1745e93f",
  15. "X-User-Id: 1",
  16. "accept: application/json"
  17. ],
  18. ]);
  19.  
  20. $response = curl_exec($curl);
  21. $err = curl_error($curl);
  22.  
  23. curl_close($curl);
  24.  
  25. if ($err) {
  26. echo "cURL Error #:" . $err;
  27. } else {
  28. echo $response;
  29. }
Success #stdin #stdout 0.03s 26316KB
stdin
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://a...content-available-to-author-only...s.ai/v2/client/offers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (HTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
    "X-Api-Token: ca4bc98f-1c8b-4e8d-81ac-377f1745e93f",
    "X-User-Id: 10",
    "accept: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
stdout
cURL Error #:Could not resolve host: api.bitlabs.ai