I have some images, that I need to give to a server using JSON. I decided to use Base64 as encoding system. In Python 2, I could simply use:
with open(path, "rb") as imageFile:
img_file = imageFile.read()
img_string = base64.b64encode(img_file)
but in Python 3 it doesnt work anymore. What do I have to change to get this in Python 3 to work?