Blobs with HTTP Post and Angular 5 — A short story

Suren K
TechInPieces
Published in
3 min readOct 10, 2018

--

Here’s a short story of how to save loads of time to make Angular work with Blobs.

Chapter 5: The climax

No.. i’m not nuts. Wanted to spill the beans first.. i know developers are very impatient! I myself am one..

In the world of Angular 5.0.0, when dealing with blobs use

responseType: 'blob' as 'json'
instead of
responseType: 'blob'

The application works and the developer lives happily ever after.. The END!!!

Chapter 1: What i wanted to do

To begin with, i’m building a website that displays thumbnails retrieved from a URL. On clicking on the thumbnail, the full sized image loads in a new page. Like a typical carousel. But the catch is that the thumbnail is generated dynamically and does not load from or stored locally.

Use-case: Image at a URL → Run through a Web service to get thumbnail → Web service responds with a thumbnail of the image → Display the thumbnail on the web page.

Interesting??? Sometimes, developers get these crazy ideas to push technology limits.

Chapter 2: The Challenges

--

--

Suren K
TechInPieces

Software Engineering Manager, Programmer, Architect, Inventor, Speaker and Writer. Works @Capgemini https://surenk.com