Display image from API respnse

I make a custom API call to my own server where the response is a json with some data and an image that I want to display on the screen. How should I send the image to the app, and how do I parse it to display app-side? Currently sending as image bytes b64 and utf-8 encoded.

Thanks!

Try a tip from here, where it is suggested to transfer the image in base64.

1 Like

Thanks actech for the link, very helpful! I think I have it working, except that my data is encoded both in base64 then in utf-8, do you know how I can decode the utf-8 before using the base64 data?

There are many online services for decoding utf-8 to base64.

https://www.motobit.com/util/base64-decoder-encoder.asp?charset=utf-8

https://calcus.ru/base64

Thanks for the links, I am hoping to decode all in app as the image will change with each server call, these links don’t seem to have an api as an option. Something is happening in my app where the image is being set to a blank image (the container grows, but its blank) just using the “join” block for "data: image/png; base64, " and the image bytes string from the call to my server. Did I structure the string correctly?

API Base64 that would be great!

You understand the structure correctly. Some services can generate a string completely, starting with data: