title: PHP file_get_contents and Asana API
body: <p>I’m trying to retrieve some value from our asana workspace.</p>
  
  <p>I’ve been able to do it with javascript</p>
  
  <pre><code>var bearerToken = "bearer APIKEY";
      var requestUrl = "https://app.asana.com/api/1.0/projects/PROJECTID/tasks"
       var headers = {
        "Authorization" : bearerToken
  
      };
  
      var reqParams = {
          method : "GET",
          headers : headers,
          muteHttpExceptions: true
        };
  
      let res= await fetch(requestUrl,reqParams); // (2)
  </code></pre>
  
  <p>But for safety reason, i’m trying to convert this code to PHP so :</p>
  
  <pre><code>$url = 'http://app.asana.com/api/1.0/projects/PROJECTID/tasks';
  
  
  $opts = [
      "http" =&gt; [
          "method" =&gt; "GET",
          "header" =&gt; "Content-Type: application/json\r\n" .
              "charset=utf-8\r\n" ,
              "Authorization : bearer APIKEY \r\n"
      ]
  ];
  
  $context = stream_context_create($opts);
  
  
  $file = file_get_contents('app.asana.com/api/1.0/projects/1158939083333529/tasks', false, $context);
  
  $file = file_get_contents($url, false, $context);
  $json_echo = json_decode($file)
   echo $json_echo;
  </code></pre>
  
  <p>The echo will return empty value …</p>
  
  <p>Best regards</p>