I\'ve an API which returns an excel document as response. The request will be one simple json.
I\'ve searched google and found some code base to download the file and I
You need to Add { responseType : 'application/octet-stream'} in your get request as No need to call post method
{ responseType : 'application/octet-stream'}
And in .ts file
DownLoadExcel(){
this.MprService.downLoadRFQInfoExcel(this.revisionId).subscribe(data =>{this.downloadFile(data)});
}
downloadFile(data: Blob) {
const contentType = 'application/vnd.openxmlformats-ficedocument.spreadsheetml.sheet';
const blob = new Blob([data], { type: contentType });
const url = window.URL.createObjectURL(blob);
window.open(url);
}