I have an api that returns a gz file. The application from where I am running the api accepts only json formats. Is there a way to attach the returned gz file to a json object? Would converting the gz file to base64 format and then creating a json object like { "file": "the base64 format" } work?
print(json.dumps({'file': base64.b64decode(response_alert.content)}))
I get the error
Object of type bytes is not JSON serializable