title: Get file content from private GitHub repository via JavaScript
body: <p>I would like to access the content of a file I uploaded to GitHub via Node.js.</p>
  
  <p>The GitHub repository is private, so I have generated an access token at <a href="https://github.com/settings/tokens" rel="nofollow noreferrer">https://github.com/settings/tokens</a></p>
  
  <p>Unfortunately, I keep getting a 404 – Not found error.  What am I doing wrong?</p>
  
  <pre><code>const request = require('request');
  
  const URL = 'https://raw.githubusercontent.com/myuser/myrepo/master/myfile.js';
  const TOKEN = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
  
  var options = {
    url: URL,
    headers: {
      'Authorization': TOKEN
    }
  };
  
  function callback(error, response, body) {
        console.log(response.statusCode);
        console.error(error);
        console.log(body);
  }
  
  request(options, callback);
  </code></pre>