io.BytesIO.getvalue

BytesIO.getvalue() → bytes.

Retrieve the entire contents of the BytesIO object.