Anvil Server disconnects when large amounts of data are passed back

Further investigation revealed that the data was actually 4.9 MB rather than 109 KB, which explains why the transfer was failing. Until we have support for sending larger Python objects, the workaround is to send as a Media object:

return anvil.BlobMedia("application/json", json.dumps(data))

And then decode the JSON at the other end:

data = json.loads(returned_media.get_bytes())
2 Likes