I have the following code:
data = open('/tmp/books_read.png', "rb").read()
encoded = base64.b64encode(data)
retObj = {"groupedImage": encoded}
return func.HttpResponse(
json.dumps(retObj),
mimetype="application/json",
status_code=200)
... and it throws the following error:
Object of type bytes is not JSON serializable Stack
May I know how do I fix this?