fork download
  1. <?php
  2.  
  3. $curl = curl_init();
  4.  
  5. CURLOPT_URL => "https://w...content-available-to-author-only...i.com/",
  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. "x-rapidapi-host: weatherapi-com.p.rapidapi.com",
  14. "x-rapidapi-key: 1caea1f23fmsh7b6dcc08a73f460p1be99bjsnbe0dc6d81ffa"
  15. ],
  16. ]);
  17.  
  18. $response = curl_exec($curl);
  19. $err = curl_error($curl);
  20.  
  21. curl_close($curl);
  22.  
  23. if ($err) {
  24. echo "cURL Error #:" . $err;
  25. } else {
  26. echo $response;
  27. }
  28. ?>
Success #stdin #stdout 0.03s 26420KB
stdin
Standard input is empty
stdout
cURL Error #:Could not resolve host: weatherapi-com.p.rapidapi.com