I believe the term you’re looking for is “serialisation” (or “serialization” for our US colleagues) - the act of representing an object in a form suitable for streaming across a serial connection where the order of that data matters (think of the days of magnetic tape storage for a good analogy).
The connection between the client and server in any web app is just such a connection and any data sent across must be serialised first. JSON is a common way to handle that and several Python types can be serialised using JSON without any intervention (dicts, lists).
However, for more complex objects, you have to define the serialisation yourself. There’s a very good library called marshmallow for doing that or you can just roll your own.
You can also see an example of me having to serialise data table rows regularly and writing a module to do that dynamically at Dynamic serialisation of data table rows