Unet LLAPI/Transport layer best way to send data?

I am currently trying to make a game that utilizes Unity’s LLAPI for networking. Of the many tutorials I have seen, they all seem to just send data as strings. I’m trying to come up with my own way and create a serializable object called NetworkMessage, and being able to store any object inside of that. However this does not seem to work the way I hoped it would.

My question is, what’s the best way to send data through the LLAPI?

You can send your message as anything, as long as it can be serialized. You will need a serializer for this. I use .Nets Binary Formatter for this task.

with “using System.Runtime.Serialization.Formatters” you get Access to this tool:

BinaryFormatter MyFormatter = new BinaryFormatter()