Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: PHP
Posted by: userc865b
Added: Oct 26, 2018 7:28 AM
Views: 108
Tags: php
  1. /*
  2. $json = file_get_contents('https://feiertage-api.de/api/?jahr=2019');
  3. $obj = json_decode($json);
  4. echo $obj->access_token;
  5. */
  6.  
  7. $url = "https://feiertage-api.de/api/?jahr=2019";
  8.  
  9. $ch = curl_init();
  10. curl_setopt($ch, CURLOPT_URL, $url);
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  13. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
  14. // This is what solved the issue (Accepting gzip encoding)
  15. //curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");
  16. $response = curl_exec($ch);
  17. echo $response;