title: Downloading Excel data using Axios from Laravel backend is not working
body: <p>I am developing a Web application using React JS for the front-end and Laravel for the back-end API. Now, what I am trying to do is I am trying to fetch the Excel data from the backend using Axios and then download the file. </p>
  
  <p>This is my Laravel API controller action method.</p>
  
  <pre><code>function downloadExcel(Request $request)
  {
      //other code goes here
      return Excel::create($left_photo-&gt;id . "-" . $right_photo-&gt;id, function($excel) use ($excel_data)
          {
  
              // Set the spreadsheet title, creator, and description
              $excel-&gt;setTitle('Mapping points');
              $excel-&gt;setCreator('Laravel')-&gt;setCompany('Memento');
              $excel-&gt;setDescription('Mapping points file');
  
              // Build the spreadsheet, passing in the payments array
              $excel-&gt;sheet('sheet1', function($sheet) use ($excel_data)
              {
                  $sheet-&gt;fromArray($excel_data, null, 'A1', false, false);
              });
  
          })-&gt;download('xlsx');
  }
  </code></pre>
  
  <p>I fetch the data from the react js application using Axios like this.</p>
  
  <pre><code>export const getHttpClientFileDownload = (path) =&gt; {
    let accessToken = localStorage.getItem("access_token");
    return Axios({
      url: getApiBaseEndpoint() + path,
      method: 'GET',
      responseType: 'blob', // important
      headers : { 'api-version': API_VERSION, 'Authorization': 'Bearer ' + accessToken }
    })
  }
  
  exportExcel()//this is the download medthod in the component
      {
          let path = 'photos/matching-points/excel?left_photo_id=' + this.props.leftImageId + "&amp;right_photo_id=" + this.props.rightImageId;
          //let path = "curator/event/" +this.props.match.params.id + "/details";
          getHttpClientFileDownload(path)
          .then((response) =&gt; {
              alert('Everything is alright')
          })
      }
  </code></pre>
  
  <p>As you can see in the above code, if the request success, it should alert a message, "Everything is alright". But it is not alerting the message. But in the  browser, it is successful.</p>
  
  <p><a href="https://i.stack.imgur.com/5YUaD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5YUaD.png" alt="enter image description here"></a></p>
  
  <p>When I make the request to the link that is returning just normal JSON response, it is alerting the message as expected. Only it is not working as expected when I make the request to the aforementioned Excel API.</p>
  
  <p>I cannot use direct download link because I am doing some authorization on the server-side.</p>