How to download files using axios.post in React us

2019-08-25 02:01发布

问题:

I have used this How to download files using axios.post from webapi (It could be duplicate of this) to work on this scenario but i am not getting success.

 React: 
   axios.post("URL",{data:data, responseType: "blob"})
  1. In response i am getting corrupted data, not bytes.
  2. ResponseType works with get request but why not with post?

WebAPI Core: return File(arraybytes, "application/vnd.openxmlformats- officedocument.spreadsheetml.sheet", "test.xlsx");