title: How to download a github json
body: <p>I have a problem, I would try to download all the json generated by this url </p>
  
  <pre><code>https://api.github.com/repos/xxxx/xxxx/contents/xxxxxxx?ref=master
  </code></pre>
  
  <p>I have a json result like that</p>
  
  <pre><code>[
    {
      "name": "xxxx.png",
      "path": "xxxx/xxxx.png",
      "sha": "8b33da362caab310626daa2b70b232a98b38c6db",
      "size": 136356,
      "url": "https://api.github.com/repos/xxxx/xxxx/contents/xxxx/xxxx.png?ref=master",
      "html_url": "https://github.com/xxxx/xxxx/blob/master/xxxx/xxxx.png",
      "git_url": "https://api.github.com/repos/xxxx/xxxx/git/blobs/8b33da362caab310626daa2b70b232a98b38c6db",
      "download_url": "https://raw.githubusercontent.com/xxxx/xxxx/master/ModuleInfosJson/xxxx.png",
      "type": "file",
      "_links": {
        "self": "https://api.github.com/repos/xxxx/xxxx/contents/xxxx/xxxx.png?ref=master",
        "git": "https://api.github.com/repos/xxxx/xxxx/git/blobs/8b33da362caab310626daa2b70b232a98b38c6db",
        "html": "https://github.com/xxxx/module_apxxxx/blob/master/xxxx/xxxx.png"
      }
    }
  ]
  </code></pre>
  
  <p>I write this but it does'nt work and I have this message :  failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden</p>
  
  <pre><code>Warning:    fopen([{"name":"xxxxxx.png","path":"xxxxxx/xxxxxxx.png","sha":"..............
  </code></pre>
  
  <p>My directory is in 777.</p>
  
  <pre><code> $json = @file_get_contents($this-&gt;GetGithubRepo() . '/' . $module_name . '/contents/'  . $this-&gt;ModuleInfosJson  . '?ref=master', true, $this-&gt;context );
      file_put_contents(OSCOM::getConfig('dir_root', 'Shop') . $this-&gt;ModuleInfosJson . '/Cache/' . $module_name . '.json', fopen($json, 'r'));
  </code></pre>
  
  <p>but if I write the code like that, it's ok but I need the information like sha, git ..., That's I need, not in this case.</p>
  
  <pre><code>  $download = 'https://raw.githubusercontent.com/ClicShoppingAddsOn/' . $module_name . '/master/' . $this-&gt;ModuleInfosJson . '/' . $module_name . '.json';
      file_put_contents(OSCOM::getConfig('dir_root', 'Shop') . $this-&gt;ModuleInfosJson . '/Cache/' . $module_name . '.json', fopen($download, 'r'));
  </code></pre>
  
  <p>Thank you.</p>