title: Using Javascript to add custom http header and trigger file download
body: <p>I would like to start a simple file download through the browser, however an access token must be passed with a custom HTTP header:</p>
  
  <pre><code>GET https://my.site.com/some/file
  Authorization: access_token
  </code></pre>
  
  <p>How can I inject the <em>Authorization:</em> header following the site URL?
  I know it's possible to do that using query string, but I want to do it using headers.</p>
  
  <p>I'm familiar with XMLHttpRequest, but as far as I understand it does not trigger download, it only reads content and the file I want to download is few hundred MBs at least.</p>
  
  <pre><code>xhr.setRequestHeader('Authorization', 'access_token');
  </code></pre>
  
  <p>This looks like a simple task, but I'm inexperienced coder so any help would be nice. Thanks.</p>