title: How to download excel in response from api react.js
body: <p>My api is responding like this demo [URL][https://mytutari.com/webservices/contract/exportcallnote/10377431] If i click on url it get downloaded automatically. But when I try to post some data using POST request in axios response I am getting this how to handle.
  <strong>API response</strong></p>
  <pre><code>&gt; PKk)S docProps/PKk)SéÃ™£docProps/app.xmlÏ1ƒ0à½¿B²kl‡R$êR:w°ÝCrjÀÜIrý÷M)Ô½ããÁÇ{ª]ý”-¢#¬Å±(EhÈ:jñènùEd‘5Z=B-6ˆ¢mêh†Àb–Œµ™çJÊhFð:©ÆÔô¼æÃ
  &gt; ©ï+™—dy*Ë³„•-Ø|þâ+Vÿ‹Z2Ÿ}ñÙmsòÕë©sšRÉ=(¹ßhÞPKk)S…]ØÓ
  &gt; docProps/core.xmlm‘ËNÃ0E÷|Eä}b;¨²’t*Ø ÎZÄÙ¦iùz’´
  &gt; uçñ=&gt;šñ‹­n“ ú ¬)  ÏIÐH[+Ó”äyµLç$  L
  &gt; ­5X’²¨.PKk)S  docProps/PKk)SéÃ™£docProps/app.xmlÏ1ƒ0à½¿B²kl‡R$êR:w°ÝCrjÀÜIrý÷M)Ô½ããÁÇ{ª]ý”-¢#¬Å±(EhÈ:jñènùEd‘5Z=B-6ˆ¢mêh†Àb–Œµ™çJÊhFð:©ÆÔô¼æÃ
  &gt; ©ï+™—dy*Ë³„•-Ø|þâ+Vÿ‹Z2Ÿ}ñÙmsòÕë©sšRÉ=(¹ßhÞPKk)S…]ØÓ
  &gt; docProps/core.xmlm‘ËNÃ0E÷|Eä}b;¨²’t*Ø ÎZÄÙ¦iùz’´
  &gt; uçñ=&gt;šñ‹­n“ ú ¬)  ÏIÐH[+Ó”äyµLç$  L ­5X’²¨.
  </code></pre>
  <p><strong>API call</strong></p>
  <pre><code> ```const formData = new FormData();
  formData.append(&quot;DealerID&quot;, DealerID);
  formData.append(&quot;FomDate&quot;, fromdate);
  formData.append(&quot;ToDate&quot;, toDate);
  formData.append(&quot;FixedDateParameter&quot;, FixedDateParameter);
  formData.append(&quot;export_type&quot;, export_type);
  //api
  const dashboardexport_response = await dashboardexport({ formData });```
  </code></pre>
  <p><strong>dashboardexport</strong></p>
  <pre><code>  let url = API + &quot;/dashboard/dashboardexport&quot;;
  
    formData.append(&quot;pcp_user_id&quot;, pcp_user_id);
    formData.append(&quot;role_id&quot;, role_id);
    formData.append(&quot;user_id&quot;, user_id);
    try {
      const response = await axios.post(url, formData, { header });
      return response.data;
    } catch (error) {
      throw Error(error);
    }
  };```
   
  </code></pre>