I can succesfully use a HTTP GET to retrieve an image via services like Postman and Hurl.it.
I'm now trying to obtain the same image via Angular HttpClient as blob. Code is basically as is:
this.http.get('via.placeholder.com/200x200',{ responseType: 'blob'}).subscribe(data => this.d = data);
Whether I use map and subscribe, I can't retrieve the image data. I always get the same CORS error in Chrome:
Failed to load via.placeholder.com/200x200: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 405
Now I know the "why is this working with Postman but not in my code" has been answered here.
That said, is there still a way, using javascript/angular and without using a proxy, to simply get an image from a website via HTTP GET?