How to get image from rest api using HttpClient in angular 4
问题 I have a simple cuestion. I have the following service in angular 4 app. getProviderPhoto(id:string){ return this.http.get(this.apiUrl+"/"+id+"/images", {responseType: "blob"}); } I need to convert this Blob response to Image file to use the following method: createImageFromBlob(image: Blob) { let reader = new FileReader(); this.photo = new File([image],"foto.png",{ type: 'image/png' }); reader.readAsDataURL(this.photo); reader.onload = (event: any) => { this.image=event.target.result;