Automatically JSON encode a message if the body is a dict or list