Dict serialization for passing data