title: Initiate File Download via GET request
body: <p>So I have ExtJS application in which a certain open in Combo leads to Download of file (read: Export to PDF). Now currently we do that using <code>window.open</code> in which we hit a specific URL which is RESTful in nature and something similar to.</p>
  
  <pre><code>window.open('https://example.com/myapp/api/module/someId/exportPDF.pdf?clientId=bizzare123&amp;param1=someValue');
  </code></pre>
  
  <p>This opens up new Tab and I get the file to download. Now this is theoretically a GET request (though it doesn't appear in Chrome DevTools' Network tab), and I want to pass some JSON data as request body (data is large so I can't fit it in request params).</p>
  
  <p>Can this be done by calling same URL using <code>Ext.Ajax.request</code> and passing <code>jsonData</code>? (I believe then I'll have to handle file coming in the response within <code>success</code> callback.</p>
  
  <p>Thanks!</p>
  
  <p>P.S. I'm on ExtJS 4.0</p>
  
  <p><strong>Update</strong></p>
  
  <p>Earlier we had only GET request to download the file but to support new feature, we had to customize download by sending POST request first, and API then sent file directly in response to POST request.</p>
  
  <p>But as <a href="https://stackoverflow.com/users/1387519/rixo">rixo</a> mentioned in comments that async download of file might not be possible directly, I had to change API such that it sends file URL instead, in POST request, and then I can hit that URL and initiate file download. And given that it's huge enterprise webapp impacting millions of users mostly using IE, I wanted to avoid using modern APIs (which are obviously tempting but not supported on IE, like always).</p>