I have a rest API which I am calling to retrieve a PNG image to display on my page.
My Code:
void getProfile
The problem is this line:
Blob blob = new Blob(request.response);
The Blob constructor expects a List
instead of another Blob
(which request.response
is in your use case): factory Blob(List blobParts, [String type, String endings])
Just delete the line, and directly call reader.readAsDataUrl(request.response)
, and it should work.