title: Open URL with header {"Accept" : "application/octet-stream"} in a new window with javascript
body: <p>I want to open a file (format could vary between things like .docx, .pdf and .jpg) in a new window when someone clicks on a button. However, the URL where the file is located can return either the file, when I use the header <code>{"Accept" : "application/octet-stream"}</code>, or it can return a JSON file with data when using the header <code>{"Accept" : "application/json"}</code>.</p>
  
  <p>When I do </p>
  
  <pre><code>window.open(myUrl);
  </code></pre>
  
  <p>I cannot specify if I get my octet-stream or json. How can I add my header, or otherwise ensure that I get the proper file?</p>