I am trying to display a PDF file created from the server for viewing in my Angular 2 RC 5 project. Right now, the ASPNETCORE server returns the object as "application / pdf" and the Angular client is trying to parse the answer as blob. However, on the client side, the following error occurs:
Error: The request body isn't either a blob or an array buffer
The code I use to invoke the PDF server is essentially:
getHeaders() : Headers { var headers = new Headers({ 'responseType': 'application/blob' }); return headers; } getBlob() { return this.http.get(uri, new RequestOptions({headers: this.getHeaders()}, body: "" })) .map(response => (<Response>response).blob()); }
angular pdf asp.net-core blob
John
source share