title: Download a pdf file using https path in javascript
body: <p>I have an ajax call to the controller which returns in success block as a path to the pdf file which something looks like this <code>www. bts.abcd.com/ReportPdf/BH00118051710501_1_1.pdf</code>, now i want to write some code in javascript that would download this file.
  I have tried various methods like <code>winodw.location.href="path"</code> but this only opens the file in new window not downloading it.
  here's my code.</p>
  
  <p>`</p>
  
  <pre><code>$.ajax({
        type: "POST",
       url: "/Reporting/ReportAPI",
       data: '{PatientId:"BH0012"}',
      contentType: "application/json,utf=charset-8",
      datatype: "JSON",
       success: function (response) {
  //response= www.bts.abcd.com/ReportPdf/BH00118051710501_1_1.pdf
  //Code for downloading the file
                  }
              });
  </code></pre>
  
  <p>`
  Different methods to achieve the same result will also be appreciated.</p>