I have an api response which return a xlsx file as response.
the api is triggered on button click and I need to download it as on response.
every api call is gone through a service which handles appends token to the url for authentication purposes.which basically means that I cannot use methods like this the one mentioned here. the response I am getting is like this ( response when debugged ). I have tried
a.href = window.URL.createObjectURL(response)
and
a.href = window.URL.createObjectURL(new blob([response]))
and tried downloading but but spreadsheet is corrupted ( I know the file is fine sice swagger returns the file properly).
how do I get this file as that of in swagger like this so that i can download in a.click()
.
this is my api from dot net
thank you in advance.