Image in base64 by Webservice

2

Is it OK to load an image encoded in base64 by a REST service? charge the data of a business and send the image of that business already in base64 although I do not know if it is good practice to do so, I want to know if I am doing well, and if not how to send an image of my server to the client? the data will be consumed in Android and the service is done in PHP.

JSON

{
"IDNEGOCIO":18,
"IDCATEGORIA":15,
"NOMBRENEGOCIO":"PIZZAS ANGGELOTI",
"IMAGEN":"\/93453453453453433SDFDSD8FSD7F8SD7F7SD9F8S89F..."
}
    
asked by Carlos Hernández 08.02.2017 в 20:32
source

1 answer

0

Depending on two factors:

1) If you do not mind that your image is visible from a browser you can put that image in a URL, and in the JSON you get the URL, later you can put in an ImageView when you need that image. Keeping it in cache.

2) If you do not want them to be visible and more private, you can do it in base64 and then decode it on the device.

Another option is to get it through sockect with a server, but seeing what you want it for, this option does not come much to the subject.

    
answered by 10.02.2017 в 12:20