Download binary file with Axios : <p>For example, downloading of PDF file:</p>

<pre><code>axios.get('/file.pdf', {
      responseType: 'arraybuffer',
      headers: {
        'Accept': 'application/pdf'
      }
}).then(response =&gt; {
    const blob = new Blob([response.data], {
      type: 'application/pdf',
    });
    FileSaver.saveAs(blob, 'file.pdf');
});
</code></pre>

<p>The contend of downloaded file is:</p>

<pre><code>[object Object]
</code></pre>

<p>What is wrong here? Why binary data not saving to file?</p>
