title: PHP Curl with Google Calendar
body: <pre><code>&lt;?php
  
  
  if(isset($_GET['token']))
  {
  
  
      $url="http://www.google.com/calendar/feeds/default/allcalendars/full";
      $useragent="PHP 5.2";
      $header=array(  "GET /accounts/AuthSubSessionToken HTTP/1.1",
                      "Content-Type: application/x-www-form-urlencoded",
                      "Authorization: AuthSub token=".$_GET['token'],
                      "User-Agent: PHP/5.2",
                      "Host: https://www.google.com",
                      "Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2",
                      "Connection: keep-alive"
                  );
  
      $ch = curl_init(); 
  
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_TIMEOUT, 60);
      curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
      curl_setopt($ch, CURLOPT_URL, $url); 
  
      $data = curl_exec($ch); 
  
      print_r($data);
  }
  ?&gt;
  </code></pre>
  
  <p>The result is page not found. However, I call <a href="http://www.google.com/calendar/feeds/default/allcalendars/full" rel="nofollow noreferrer">http://www.google.com/calendar/feeds/default/allcalendars/full</a> from firefox , it's return XML file. So, I think, my code may wrong. But I can't find the error. :(</p>