I saw on forums that the error can be caused by the "type", could anyone give me any tips?
Service
getDownloadZip(): Observable<any> {
const url = `${this._URL_SERVICE}/result`;
return this.http.get<Array<any>>(url, this.httpOptions).pipe(retry(1), catchError(this.handleError));
}
TS
downloadZip() {
this.servicosApiService
.getServicosCSV()
.subscribe((res: any) => {
const file = new Blob([res], {
type: res.type
});
console.log(file);
const blob = window.URL.createObjectURL(file);
const link = document.createElement('a');
link.href = blob;
link.download = 'report.zip'
link.click();
window.URL.revokeObjectURL(blob);
link.remove();
})
}
Error
ERROR Error code: 200, message: Http failure during parsing for http://localhost/api/v1/result