Не могу преобразовать json в base64
jsonSend = {"pres": {
"file": i,
"data": data
}
b = json.loads(s1)
base = base64.b64encode(b)
Ошибка the JSON object must be str, bytes or bytearray, not dict
Пробовал так
s1 = json.dumps(jsonSend)
b = json.loads(jsonSend)
base = base64.b64encode(b)
Ошибка Object of type bytes is not JSON serializable