Angular 4.3: Getting an arraybuffer with new HttpClient
问题 I would like to change to the new HttpClient. Until now I handle file downloads the following: getXlsx (): Observable<any> { return this.http.get('api/xlsx', { responseType: ResponseContentType.ArrayBuffer, // set as ArrayBuffer instead of Json }) .map(res => downloadFile(res, 'application/xlsx', 'export.xlsx')) .catch(err => handleError(err)); } export function downloadFile(data: any, type: string, filename: string): string { const blob = new Blob([data._body], { type }); const url = window